import ShippingTree from "./components/ShippingTree.tsx";
import { Group, ScrollArea, Stack } from "@mantine/core";
import useShipping from "./hooks/useShipping.tsx";
import useShippingQrs from "./hooks/useShippingQrs.tsx";
import { IconPrinter, IconQrcode } from "@tabler/icons-react";
import InlineButton from "../../../../components/InlineButton/InlineButton.tsx";


const ShippingTab = () => {
    const {
        onCreateBoxInDealClick,
        onCreatePalletClick,
    } = useShipping();

    const {
        onGetDealQrPdfClick,
        onGetPalletsPdfClick,
        onGetBoxesPdfClick,
    } = useShippingQrs();

    return (
        <Stack h={"94vh"}>
            <Group>
                <InlineButton onClick={() => onCreatePalletClick()}>
                    Добавить паллет
                </InlineButton>
                <InlineButton onClick={() => onCreateBoxInDealClick()}>
                    Добавить короб
                </InlineButton>
                <InlineButton onClick={() => onGetDealQrPdfClick()}>
                    <IconQrcode />
                    Сделка
                </InlineButton>
                <InlineButton onClick={() => onGetPalletsPdfClick()}>
                    <IconPrinter />
                    Паллеты
                </InlineButton>
                <InlineButton onClick={() => onGetBoxesPdfClick()}>
                    <IconPrinter />
                    Короба
                </InlineButton>
            </Group>
            <ScrollArea>
                <ShippingTree />
            </ScrollArea>
        </Stack>
    );
};

export default ShippingTab;
