fix status value
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { createColumnHelper } from "@tanstack/react-table";
|
import { createColumnHelper } from "@tanstack/react-table";
|
||||||
|
import { ShieldCross, ShieldTick } from "iconsax-react";
|
||||||
|
|
||||||
type ColumnConfig = {
|
type ColumnConfig = {
|
||||||
accessor: any;
|
accessor: any;
|
||||||
@@ -11,7 +12,7 @@ export const createColumns = <T,>(columnConfigs: ColumnConfig[]) => {
|
|||||||
return columnConfigs.map(config =>
|
return columnConfigs.map(config =>
|
||||||
columnHelper.accessor(config.accessor, {
|
columnHelper.accessor(config.accessor, {
|
||||||
header: () => config.header,
|
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,
|
enableSorting: config.enableSorting ?? true,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ type colConfig = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const columnConfigs: colConfig[] | [] = [
|
const columnConfigs: colConfig[] | [] = [
|
||||||
{ accessor: "device_model", header: "وضعیت" },
|
{ accessor: "status", header: "وضعیت" },
|
||||||
{ accessor: "dollar", header: "دلار" },
|
{ accessor: "dollar", header: "دلار" },
|
||||||
{ accessor: "score", header: "امتیاز" },
|
{ accessor: "score", header: "امتیاز" },
|
||||||
{ accessor: "device_model", header: "مدل دستگاه" },
|
{ accessor: "device_model", header: "مدل دستگاه" },
|
||||||
|
|||||||
Reference in New Issue
Block a user