import { FC } from "react";
import { ButtonProps } from "@mantine/core";
import { modals } from "@mantine/modals";
import { useServicesContext } from "@/app/services/contexts/ServicesContext";
import InlineButton from "@/components/ui/InlineButton/InlineButton";

type Props = ButtonProps;

const CreateServiceKitButton: FC<Props> = () => {
    const { servicesKitCrud } = useServicesContext();

    const onCreateClick = () => {
        modals.openContextModal({
            modal: "servicesKitEditorModal",
            title: "Создание набора услуг",
            withCloseButton: false,
            innerProps: {
                onCreate: servicesKitCrud.onCreate,
                isEditing: false,
            },
        });
    };

    return <InlineButton onClick={onCreateClick}>Создать набор</InlineButton>;
};

export default CreateServiceKitButton;
