diff --git a/src/app/(dashboard)/dashboard/criteria/add/page.tsx b/src/app/(dashboard)/dashboard/criteria/add/page.tsx new file mode 100644 index 0000000..3a11f98 --- /dev/null +++ b/src/app/(dashboard)/dashboard/criteria/add/page.tsx @@ -0,0 +1,26 @@ +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"; +import { Separator } from "@/components/ui/separator"; +import AddCriteriaForm from "@/components/add-criteria-form"; + +export default function SettingsDisplayPage() { + return ( + +
+ + + + Create Criteria + + + + + + + + +
+ +
+ ); +} diff --git a/src/components/add-criteria-form.tsx b/src/components/add-criteria-form.tsx new file mode 100644 index 0000000..725dd38 --- /dev/null +++ b/src/components/add-criteria-form.tsx @@ -0,0 +1,106 @@ +"use client"; + +import { zodResolver } from "@hookform/resolvers/zod"; +import { useForm } from "react-hook-form"; +import { z } from "zod"; + +import { Button } from "@/components/ui/button"; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { toast } from "@/components/ui/use-toast"; +import { Input } from "./ui/input"; +import { Textarea } from "./ui/textarea"; + +const displayFormSchema = z.object({ + name: z.string().trim().min(1, "Name is required."), + description: z.string().trim().min(1, "Description is required."), + prompt: z.string().trim().min(1, "Prompt is required."), +}); + +type DisplayFormValues = z.infer; + +// This can come from your database or API. +const defaultValues: Partial = { + name: "", + description: "", + prompt: "", +}; + +export default function AddCriteriaForm() { + const form = useForm({ + resolver: zodResolver(displayFormSchema), + defaultValues, + }); + + function onSubmit(data: DisplayFormValues) { + toast({ + title: "You submitted the following values:", + description: ( +
+          {JSON.stringify(data, null, 2)}
+        
+ ), + }); + } + + return ( +
+ + ( + + Name + + + + + + )} + /> + ( + + Description + +