"use client";

import { FC } from "react";
import { Group } from "@mantine/core";
import { useModulesContext } from "@/app/modules/contexts/ModulesContext";
import InlineButton from "@/components/ui/InlineButton/InlineButton";
import useIsMobile from "@/hooks/utils/useIsMobile";

const ModulesHeader: FC = () => {
    const {
        modulesActions: { onCreate },
    } = useModulesContext();
    const isMobile = useIsMobile();

    return (
        <Group
            wrap={"nowrap"}
            justify={"space-between"}
            mt={isMobile ? "xs" : ""}
            mx={isMobile ? "xs" : ""}>
            <InlineButton
                onClick={onCreate}
                w={isMobile ? "100%" : ""}>
                Создать модуль
            </InlineButton>
        </Group>
    );
};

export default ModulesHeader;
