Filtering table by status not working properly
As you can see in the image I am filtering my table by status which is a number and its defined in the columns.
In columns.tsx
{
header: 'Status',
accessorKey: 'status',
enableSorting: true,
cell: ({ row }) => {
const status = statuses.find(
(status) => status.value === row.original.status
);
if (!status) {
return null;
}
return (
<Badge variant={status.variant}>
{status.label} - {status.value}
</Badge>
);
},
},
The values selected in the filter by status are being added to columnFilter inside my Table.tsx component.
I dont understand why its not filtering correctly since I am passing the correct status number to the filter.
0 Replies