changes on the orders page regarding the selection options

This commit is contained in:
2026-08-27 11:41:10 +05:30
parent 4bcf604539
commit 4be2e73712

View File

@@ -344,7 +344,7 @@ export default function Orders() {
placeholder="Search by order number, address or note"
className="w-full sm:w-72"
/>
{selectedIds.length > 0 && tab !== 'cancelled' && (
{selectedIds.length > 0 && tab === 'pending' && (
<Button variant="outline" onClick={() => setCancelOpen(true)}>
<Ban className="mr-1.5 h-4 w-4" /> Cancel {selectedIds.length}
</Button>
@@ -381,8 +381,8 @@ export default function Orders() {
getRowId={(row) => row.bookingid}
loading={isLoading}
refreshing={isFetching && !isLoading}
selectedIds={selectedIds}
onSelectionChange={setSelectedIds}
selectedIds={tab === 'pending' ? selectedIds : undefined}
onSelectionChange={tab === 'pending' ? setSelectedIds : undefined}
pageSize={25}
/* No defaultSort: `sortedBookings` above already orders these newest
first by `bookingid`, and DataTable leaves rows untouched when it