diff --git a/src/app/(dashboard)/dashboard/configurations/add/page.tsx b/src/app/(dashboard)/dashboard/configurations/add/page.tsx new file mode 100644 index 0000000..39f2c3d --- /dev/null +++ b/src/app/(dashboard)/dashboard/configurations/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 AddConfigurationForm from "@/components/add-configuration-form"; + +export default function SettingsDisplayPage() { + return ( + +
+ + + + Create Configuration + + + + + + + + +
+ +
+ ); +} diff --git a/src/components/add-configuration-form.tsx b/src/components/add-configuration-form.tsx new file mode 100644 index 0000000..52b045c --- /dev/null +++ b/src/components/add-configuration-form.tsx @@ -0,0 +1,90 @@ +"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"; + +const displayFormSchema = z.object({ + name: z.string().trim().min(1, "Name is required."), + value: z.string().trim().min(1, "Value is required."), +}); + +type DisplayFormValues = z.infer; + +// This can come from your database or API. +const defaultValues: Partial = { + name: "", + value: "", +}; + +export default function AddConfigurationForm() { + 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 + + + + + + )} + /> + ( + + Value + + + + + + )} + /> + +
+ + +
+ + + ); +} diff --git a/src/components/add-organization-form.tsx b/src/components/add-organization-form.tsx index d557404..bff3532 100644 --- a/src/components/add-organization-form.tsx +++ b/src/components/add-organization-form.tsx @@ -56,10 +56,6 @@ export default function AddOrganizationForm() { - {/* - This is your public display name. It can be your real name or a - pseudonym. You can only change this once every 30 days. - */} )} diff --git a/src/components/configurations-table/tools-table.tsx b/src/components/configurations-table/tools-table.tsx index 02fab29..27ed32f 100644 --- a/src/components/configurations-table/tools-table.tsx +++ b/src/components/configurations-table/tools-table.tsx @@ -24,13 +24,10 @@ const ToolsTable = ({ description="Manage Configurations" /> router.push(`/admin-dashboard/tools/add`)} > Add Configuration