import { useMemo } from "react";
import { MRT_ColumnDef, MRT_RowData } from "mantine-react-table";


const useResiduesTableColumns = <T extends MRT_RowData>() => {
    return useMemo<MRT_ColumnDef<T>[]>(
        () => [
            {
                header: "Название",
                accessorKey: "product.name",
                Cell: ({ row }) => row.original.product?.name ?? "-",
            },
            {
                header: "Артикул",
                accessorKey: "product.article",
                Cell: ({ row }) => row.original.product?.article ?? "-",
            },
            {
                header: "Размер",
                accessorKey: "product.size",
                Cell: ({ row }) => row.original.product?.size ?? "-",
            },
            {
                header: "Количество",
                accessorKey: "quantity",
            },
        ],
        [],
    );
};

export default useResiduesTableColumns;
