({
+ resolver: zodResolver(displayFormSchema),
+ defaultValues,
+ });
+
+ function onSubmit(data: DisplayFormValues) {
+ toast({
+ title: "You submitted the following values:",
+ description: (
+
+ {JSON.stringify(data, null, 2)}
+
+ ),
+ });
+ }
+
+ return (
+
+
+ );
+}
diff --git a/src/components/users-add-form.tsx b/src/components/add-user-form.tsx
similarity index 94%
rename from src/components/users-add-form.tsx
rename to src/components/add-user-form.tsx
index ef97558..c145311 100644
--- a/src/components/users-add-form.tsx
+++ b/src/components/add-user-form.tsx
@@ -18,7 +18,7 @@ import {
import { toast } from "@/components/ui/use-toast";
import { Input } from "./ui/input";
-const items = [
+const roles = [
{
id: "ROLE_SUPER_ADMIN",
label: "ROLE_SUPER_ADMIN",
@@ -68,7 +68,7 @@ const defaultValues: Partial = {
roles: ["ROLE_USER"],
};
-export default function UsersAddForm() {
+export default function AddUserForm() {
const form = useForm({
resolver: zodResolver(displayFormSchema),
defaultValues,
@@ -172,33 +172,33 @@ export default function UsersAddForm() {
Select the items you want to display in the sidebar.
*/}
- {items.map((item) => (
+ {roles.map((role) => (
{
return (
{
return checked
- ? field.onChange([...field.value, item.id])
+ ? field.onChange([...field.value, role.id])
: field.onChange(
field.value?.filter(
- (value) => value !== item.id
+ (value) => value !== role.id
)
);
}}
/>
- {item.label}
+ {role.label}
);
diff --git a/src/components/organizations-table/tools-table.tsx b/src/components/organizations-table/tools-table.tsx
index 20d446d..3779d97 100644
--- a/src/components/organizations-table/tools-table.tsx
+++ b/src/components/organizations-table/tools-table.tsx
@@ -20,7 +20,7 @@ const ToolsTable = ({ organizations }: { organizations: Organization[] }) => {
description="Manage Organizations"
/>