import { Button } from '@/vdb/components/ui/button'; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/vdb/components/ui/dialog'; import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from '@/vdb/components/ui/form'; import { Input } from '@/vdb/components/ui/input'; import { Textarea } from '@/vdb/components/ui/textarea'; import { DashboardFormComponentProps } from '@/vdb/framework/form-engine/form-engine-types'; import { handleNestedFormSubmit } from '@/vdb/framework/form-engine/utils'; import { zodResolver } from '@hookform/resolvers/zod'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; import { ReviewMultiSelect } from './custom-form-components'; const formSchema = z.object({ title: z.string().min(1, 'Title is required'), body: z.string().min(1, 'Body is required'), }); type FormSchema = z.infer; export function ReviewSelectWithCreate(props: DashboardFormComponentProps) { const form = useForm({ resolver: zodResolver(formSchema), defaultValues: { title: '', body: '', }, }); const onSubmit = (data: FormSchema) => { // TODO: Handle form submission form.reset(); }; return (
Create new review
( Title )} /> ( Body