'use client'
import DataTable from "@/core/components/DataTable";
import {useMemo} from "react";

function HomeComponent() {
    const columns = useMemo(
        () => [
            {
                accessorKey: 'fullname',
                header: 'نام کامل',
                id: "fullname",
                columns: [
                    {
                        accessorKey: 'name.firstName',
                        header: 'نام',
                        id: "firstName",
                        enableColumnFilter: true,
                        datatype: "text",
                        filterFn: "contains",
                        enableClickToCopy: true,
                        columnFilterModeOptions: [
                            "equals",
                            "notEquals",
                            "contains"
                        ],
                    },
                    {
                        accessorKey: 'name.lastName',
                        header: 'نام خانوادگی',
                        id: "lastName",
                        enableColumnFilter: true,
                        datatype: "text",
                        filterFn: "contains",
                        columnFilterModeOptions: [
                            "equals",
                            "notEquals",
                            "contains"
                        ],
                    },
                ],
                enableColumnFilter: true,
                datatype: "text",
                filterFn: "contains",
                columnFilterModeOptions: [
                    "equals",
                    "notEquals",
                    "contains"
                ],
            },
            {
                accessorKey: 'address',
                header: 'آدرس',
                id: "address",
                enableColumnFilter: true,
                datatype: "text",
                filterFn: "contains",
                columnFilterModeOptions: [
                    "equals",
                    "notEquals",
                    "contains"
                ],
            },
            {
                accessorKey: 'city',
                header: 'شهر',
                id: "city",
                enableColumnFilter: true,
                datatype: "text",
                filterFn: "contains",
                columnFilterModeOptions: [
                    "equals",
                    "notEquals",
                    "contains",
                    "lessThan",
                    "greaterThan",
                    "between",
                ],

            },
            {
                accessorKey: 'state',
                header: 'وضعیت',
                id: "state",
                text: 'نام',
                enableColumnFilter: true,
                datatype: "text",
                filterFn: "contains",
                columnFilterModeOptions: [
                    "equals",
                    "notEquals",
                    "contains"
                ],
            },
            {
                accessorKey: 'state',
                header: 'محدوده',
                id: "betweenNum",
                text: 'محدوده',
                enableColumnFilter: true,
                datatype: "text",
                filterFn: "betweenNum",
                columnFilterModeOptions: [],
            },
            {
                accessorKey: 'state',
                header: 'تاریخ',
                id: "betweenDate",
                text: 'تاریخ',
                enableColumnFilter: true,
                datatype: "text",
                filterFn: "betweenDate",
                columnFilterModeOptions: [],
            },
            {
                accessorKey: 'state',
                header: 'شلکت',
                id: "select2",
                text: 'تاریخ',
                type: 'select2',
                enableColumnFilter: true,
                datatype: "text",
                filterFn: "equals",
                columnFilterModeOptions: [],
            },
            {
                accessorKey: 'state',
                header: 'سلکت',
                id: "select",
                text: 'تنتنت',
                type: 'select',
                enableColumnFilter: true,
                datatype: "text",
                filterFn: "equals",
                columnFilterModeOptions: [],
            },
        ],
        [],
    );

    return (
        <>
            <DataTable columns={columns} userId={0} pageName={'testPage'} tableName={'testTable'}/>
        </>

    );
}

export default HomeComponent;
