import { IconPlus } from "@tabler/icons-react";
import { Box, Group, Text } from "@mantine/core";
import { modals } from "@mantine/modals";
import { useStatusesContext } from "@/app/deals/contexts/StatusesContext";

const CreateStatusButton = () => {
    const { onCreateStatus } = useStatusesContext();

    const onStartCreating = () => {
        modals.openContextModal({
            modal: "enterNameModal",
            title: "Создание колонки",
            withCloseButton: true,
            innerProps: {
                onComplete: onCreateStatus,
            },
        });
    };

    return (
        <Group
            ml={"xs"}
            onClick={onStartCreating}>
            <IconPlus />
            <Box mt={5}>
                <Text>Создать колонку</Text>
            </Box>
        </Group>
    );
};

export default CreateStatusButton;
