"use client";

import { useMemo } from "react";
import Toolbar from "@/components/dashboard/inquiryPrivacyFencing/Toolbar";
import DataTable from "@/core/components/DataTable";
import { GET_INQUIRY_PRIVACY_FENCING_ROUTE } from "@/core/utils/routes";
import { Box } from "@mui/material";
import PageTitle from "@/core/components/PageTitle";

const InquiryPrivacyFencingList = () => {
    const columns = useMemo(
        () => [
            {
                accessorKey: "dabirkhaneh_number",
                header: "شماره دبیرخانه درخواست",
                id: "dabirkhaneh_number",
                enableColumnFilter: false,
                datatype: "text",
                filterFn: "notEquals",
            },
            {
                accessorKey: "marjae_pasokh",
                header: "مرجع درخواست کننده پاسخ به استعلام",
                id: "marjae_pasokh",
                enableColumnFilter: false,
                datatype: "text",
                filterFn: "equals",
            },
            {
                accessorKey: "motaghazi_is_legal",
                header: "متقاضی",
                id: "motaghazi_is_legal",
                enableColumnFilter: false,
            },
            {
                accessorKey: "nameh_date",
                header: "تاریخ نامه درخواست",
                id: "nameh_date",
                enableColumnFilter: false,
            },
            {
                accessorKey: "motaghazi_type",
                header: "نوع متقاضی",
                id: "motaghazi_type",
                enableColumnFilter: false,
            },
            {
                accessorKey: "motaghazi_firstname",
                header: "نام متقاضی",
                id: "motaghazi_firstname",
                enableColumnFilter: false,
            },
            {
                accessorKey: "motaghazi_lastname",
                header: "نام خانوادگی متقاضی",
                id: "motaghazi_lastname",
                enableColumnFilter: false,
            },
            {
                accessorKey: "national_id",
                header: "کد ملی/شناسه ملی",
                id: "national_id",
                enableColumnFilter: false,
            },
            {
                accessorKey: "tel_number",
                header: "تلفن",
                id: "tel_number",
                enableColumnFilter: false,
            },
            {
                accessorKey: "mobile_number",
                header: "تلفن همراه",
                id: "mobile_number",
                enableColumnFilter: false,
            },
            {
                accessorKey: "address",
                header: "آدرس",
                id: "address",
                enableColumnFilter: false,
            },
            {
                accessorKey: "edare_kol",
                header: "اداره كل راهداری",
                id: "edare_kol",
                enableColumnFilter: false,
            },
            {
                accessorKey: "edare_shahri",
                header: "اداره شهرستان",
                id: "edare_shahri",
                enableColumnFilter: false,
            },
            {
                accessorKey: "rah_type",
                header: "نوع راه",
                id: "rah_type",
                enableColumnFilter: false,
            },
            {
                accessorKey: "name_mehvar_fa",
                header: "نام محور",
                id: "name_mehvar_fa",
                enableColumnFilter: false,
            },
            {
                accessorKey: "mizan_harim",
                header: "میزان حریم",
                id: "mizan_harim",
                enableColumnFilter: false,
            },
            {
                accessorKey: "arze_navar",
                header: "عرض نوار تاسیساتی زیربنایی",
                id: "arze_navar",
                enableColumnFilter: false,
            },
            {
                accessorKey: "samt",
                header: "سمت",
                id: "samt",
                enableColumnFilter: false,
            },
            {
                accessorKey: "kilometr",
                header: "كيلومتر",
                id: "kilometr",
                enableColumnFilter: false,
            },
            {
                accessorKey: "zone",
                header: "zone",
                id: "zone",
                enableColumnFilter: false,
            },
            {
                accessorKey: "karbari_type",
                header: "نوع کاربری",
                id: "karbari_type",
                enableColumnFilter: false,
            },
            {
                accessorKey: "tarh_title",
                header: "عنوان طرح",
                id: "tarh_title",
                enableColumnFilter: false,
            },
            {
                accessorKey: "masahat_zirbana",
                header: "مساحت زیربنا",
                id: "masahat_zirbana",
                enableColumnFilter: false,
            },
            {
                accessorKey: "ehdasat_type",
                header: "نوع احداثات",
                id: "ehdasat_type",
                enableColumnFilter: false,
            },
            {
                accessorKey: "divarkeshi_distance",
                header: "فاصله دیوارکشی از آکس محور",
                id: "divarkeshi_distance",
                enableColumnFilter: false,
            },
            {
                accessorKey: "mahale_ejra",
                header: "محل اجرا",
                id: "mahale_ejra",
                enableColumnFilter: false,
            },
            {
                accessorKey: "traffic",
                header: "میزان ترافیک",
                id: "traffic",
                enableColumnFilter: false,
            },
            {
                accessorKey: "vaziat_eghtesadi",
                header: "وضعیت اقتصادی",
                id: "vaziat_eghtesadi",
                enableColumnFilter: false,
            },
            {
                accessorKey: "has_access",
                header: "آیا راه دسترسی از قبل وجود دارد؟",
                id: "has_access",
                enableColumnFilter: false,
            },
            {
                accessorKey: "shomare_estelam_harim",
                header: "شماره استعلام دفتر ایمنی و حریم",
                id: "shomare_estelam_harim",
                enableColumnFilter: false,
            },
            {
                accessorKey: "max_month",
                header: "ماه",
                id: "max_month",
                enableColumnFilter: false,
            },
            {
                accessorKey: "max_day",
                header: "روز",
                id: "max_day",
                enableColumnFilter: false,
            },
            {
                accessorKey: "shomare_tahaodname",
                header: "شماره تعهدنامه",
                id: "shomare_tahaodname",
                enableColumnFilter: false,
            },
            {
                accessorKey: "shomare_daftarkhaneh",
                header: "شماره دفترخانه",
                id: "shomare_daftarkhaneh",
                enableColumnFilter: false,
            },
            {
                accessorKey: "description",
                header: "توضیحات",
                id: "description",
                enableColumnFilter: false,
            },
            {
                accessorKey: "ronevesht",
                header: "رونوشت",
                id: "ronevesht",
                enableColumnFilter: false,
            },
        ],
        []
    );

    return (
        <>
            <Box sx={{ p: 1, border: 1, borderColor: "divider", borderRadius: 1 }}>
                <DataTable
                    table_title={"لیست استعلام ها"}
                    need_filter={false}
                    columns={columns}
                    table_url={GET_INQUIRY_PRIVACY_FENCING_ROUTE}
                    user_id={0}
                    page_name={"inquiryPrivacyFencing"}
                    table_name={"inquiryPrivacyFencingList"}
                    TableToolbar={Toolbar}
                />
            </Box>
        </>
    );
};
export default InquiryPrivacyFencingList;
