import { FC } from "react";
import { IconBlocks, IconEdit } from "@tabler/icons-react";
import { Tabs } from "@mantine/core";
import {
    GeneralTab,
    ModulesTab,
} from "@/app/deals/drawers/ProjectEditorDrawer/tabs";
import { ProjectSchema } from "@/lib/client";
import styles from "../ProjectEditorDrawer.module.css";

type Props = {
    value: ProjectSchema;
    onChange: (value: ProjectSchema) => void;
    onDelete: (value: ProjectSchema) => void;
};

const ProjectEditorBody: FC<Props> = props => {
    return (
        <Tabs
            defaultValue="general"
            classNames={{ tab: styles.tab }}>
            <Tabs.List>
                <Tabs.Tab
                    value="general"
                    leftSection={<IconEdit />}>
                    Общая информация
                </Tabs.Tab>
                <Tabs.Tab
                    value="modules"
                    leftSection={<IconBlocks />}>
                    Модули
                </Tabs.Tab>
            </Tabs.List>
            <Tabs.Panel value="general">
                <GeneralTab {...props} />
            </Tabs.Panel>
            <Tabs.Panel value="modules">
                <ModulesTab {...props} />
            </Tabs.Panel>
        </Tabs>
    );
};

export default ProjectEditorBody;
