quivr/frontend/lib/components/AddBrainModal/AddBrainModal.tsx
2024-01-30 13:34:32 -08:00

29 lines
685 B
TypeScript

import { FormProvider, useForm } from "react-hook-form";
import { addBrainDefaultValues } from "@/lib/config/defaultBrainConfig";
import { AddBrainSteps } from "./components/AddBrainSteps/AddBrainSteps";
import { CreateBrainProps } from "./types";
export const AddBrainModal = ({
isMenuButton,
}: {
isMenuButton?: boolean;
}): JSX.Element => {
const defaultValues: CreateBrainProps = {
...addBrainDefaultValues,
setDefault: true,
brainCreationStep: "BRAIN_TYPE",
};
const methods = useForm<CreateBrainProps>({
defaultValues,
});
return (
<FormProvider {...methods}>
<AddBrainSteps isMenuButton={isMenuButton} />
</FormProvider>
);
};