From 06849616b00a4601c73756ca1fa5b9283de92b66 Mon Sep 17 00:00:00 2001 From: mehedi-hasan Date: Sat, 20 Apr 2024 02:04:39 +0600 Subject: [PATCH] feat: added add account form --- .../dashboard/accounts/add/page.tsx | 26 ++++ src/components/accounts-table/tools-table.tsx | 2 +- src/components/add-account-form.tsx | 146 ++++++++++++++++++ 3 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 src/app/(dashboard)/dashboard/accounts/add/page.tsx create mode 100644 src/components/add-account-form.tsx diff --git a/src/app/(dashboard)/dashboard/accounts/add/page.tsx b/src/app/(dashboard)/dashboard/accounts/add/page.tsx new file mode 100644 index 0000000..66bb764 --- /dev/null +++ b/src/app/(dashboard)/dashboard/accounts/add/page.tsx @@ -0,0 +1,26 @@ +import AddAccountForm from "@/components/add-account-form"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"; +import { Separator } from "@/components/ui/separator"; + +export default function SettingsDisplayPage() { + return ( + +
+ + + + Create Account + + + + + + + + +
+ +
+ ); +} diff --git a/src/components/accounts-table/tools-table.tsx b/src/components/accounts-table/tools-table.tsx index 80eaaa6..31de73e 100644 --- a/src/components/accounts-table/tools-table.tsx +++ b/src/components/accounts-table/tools-table.tsx @@ -21,7 +21,7 @@ const ToolsTable = ({ accounts }: { accounts: Account[] }) => { description="Manage Accounts" /> ; + +// This can come from your database or API. +const defaultValues: Partial = { + balance: "", + email: "", + organization: "", +}; + +export default function AddAccountForm() { + 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 ( +
+ + ( + + User + + + + )} + /> + + ( + + Balance + + + + + + )} + /> + + ( + + User + + + + )} + /> + +
+ + +
+ + + ); +}