2023-11-14 12:56:22 +03:00
|
|
|
import { FormProvider, useForm } from "react-hook-form";
|
2023-09-20 10:35:09 +03:00
|
|
|
|
2023-11-14 12:56:22 +03:00
|
|
|
import { defaultBrainConfig } from "@/lib/config/defaultBrainConfig";
|
|
|
|
import { BrainConfig } from "@/lib/types/brainConfig";
|
2023-07-25 13:08:08 +03:00
|
|
|
|
2023-11-14 12:56:22 +03:00
|
|
|
import { AddBrainConfig } from "./components/AddBrainConfig/AddBrainConfig";
|
2023-07-25 13:08:08 +03:00
|
|
|
|
2023-09-21 10:35:53 +03:00
|
|
|
type AddBrainModalProps = {
|
|
|
|
triggerClassName?: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const AddBrainModal = ({
|
|
|
|
triggerClassName,
|
|
|
|
}: AddBrainModalProps): JSX.Element => {
|
2023-11-14 12:56:22 +03:00
|
|
|
const methods = useForm<BrainConfig>({
|
|
|
|
defaultValues: defaultBrainConfig,
|
|
|
|
});
|
2023-07-25 13:08:08 +03:00
|
|
|
|
|
|
|
return (
|
2023-11-14 12:56:22 +03:00
|
|
|
<FormProvider {...methods}>
|
|
|
|
<AddBrainConfig triggerClassName={triggerClassName} />
|
|
|
|
</FormProvider>
|
2023-07-25 13:08:08 +03:00
|
|
|
);
|
|
|
|
};
|