fix status value

This commit is contained in:
Alihaghighattalab
2024-08-10 18:05:12 +03:30
parent bfd9fa2b64
commit 7e18228d46
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
import { createColumnHelper } from "@tanstack/react-table";
import { ShieldCross, ShieldTick } from "iconsax-react";
type ColumnConfig = {
accessor: any;
@@ -11,7 +12,7 @@ export const createColumns = <T,>(columnConfigs: ColumnConfig[]) => {
return columnConfigs.map(config =>
columnHelper.accessor(config.accessor, {
header: () => config.header,
cell: (info) => info.getValue(),
cell: (info) => config.header === "وضعیت" ? info.getValue() ? <ShieldTick color="#11212D" className="flex w-full"/> : <ShieldCross color="#E51717" className="flex w-full"/> : info.getValue(),
enableSorting: config.enableSorting ?? true,
})
);