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

const CreateBoardButton = () => {
    const { onCreateBoard } = useBoardsContext();

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

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

export default CreateBoardButton;
