import { FC } from "react";
import { Stack } from "@mantine/core";
import { DealSchema } from "@/lib/client";
import ClientDataForm from "@/modules/dealModularEditorTabs/Clients/shared/components/ClientDataForm";
import ClientSelectForm from "@/modules/dealModularEditorTabs/Clients/shared/components/ClientSelectForm";
import { ClientTabContextProvider } from "@/modules/dealModularEditorTabs/Clients/shared/contexts/ClientTabContext";

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

const ClientTab: FC<Props> = ({ value, onChange }) => {
    return (
        <Stack
            flex={1}
            mt={"xs"}
            mx={"xs"}>
            <ClientTabContextProvider
                value={value}
                onChange={onChange}>
                <ClientSelectForm />
                <ClientDataForm />
            </ClientTabContextProvider>
        </Stack>
    );
};

export default ClientTab;
