debug filter select option in violation

This commit is contained in:
2026-06-10 13:36:28 +03:30
parent a798a36fcd
commit 9ee9132ed8
2 changed files with 14 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ import moment from "jalali-moment";
import { useMemo } from "react";
import RowActions from "./RowActions";
import Toolbar from "./Toolbar";
import { violationsCategoryStatus } from "@/core/utils/violationsCategoryStatus";
const ViolationsList = () => {
const columns = useMemo(
@@ -21,14 +22,20 @@ const ViolationsList = () => {
grow: false,
},
{
accessorKey: "type",
header: "نوع تخلف",
id: "type",
accessorKey: "status",
header: "وضعیت",
id: "status",
enableColumnFilter: true,
datatype: "numeric",
filterMode: "equals",
sortDescFirst: true,
grow: false,
columnSelectOption: () => {
return violationsCategoryStatus.map((category) => ({
value: category.id,
label: category.name_fa,
}));
},
Cell: ({ row }) => (row.original.type === 1 ? "خروج بدون مجوز" : "عدم تحرک"),
},
{

View File

@@ -0,0 +1,4 @@
export const violationsCategoryStatus = [
{ id: 0, name_fa: "بدون اقدام" },
{ id: 1, name_fa: "اقدام شده" },
];