import { useMemo } from "react";
import { MRT_ColumnDef } from "mantine-react-table";
import { ParsedCityBreakdownSchema } from "../../../../../client";
import { ActionIcon, Image } from "@mantine/core";

export const useBreakdownByCityTableColumns = () => {
    return useMemo<MRT_ColumnDef<ParsedCityBreakdownSchema>[]>(
        () => [
            {
                accessorKey: "baseMarketplace.iconUrl",
                header: "Маркетплейс",
                Cell: ({ cell }) => (
                    <ActionIcon
                        radius={"md"}
                        variant={"transparent"}>
                        <Image src={cell.getValue()} />
                    </ActionIcon>
                ),
                size: 10,
            },
            {
                accessorKey: "shippingWarehouse.name",
                header: "Склад отгрузки",
                size: 10,
            },
            {
                accessorKey: "quantity",
                header: "Количество",
                size: 10,
            },
        ],
        [],
    );
};
