From 0f8267a9848fa5ce16c4933aadeeab7a2221f0dc Mon Sep 17 00:00:00 2001 From: "Orace.A" Date: Thu, 27 Mar 2025 21:24:50 +0100 Subject: [PATCH] feat: add organizations data-table page --- src/app/admin/admins/page.tsx | 2 +- src/app/admin/organizations/page.tsx | 2 -- src/components/floatingLabelInput.tsx | 2 +- src/schema/index.ts | 10 ++++++++-- src/types/index.ts | 8 ++++++-- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/app/admin/admins/page.tsx b/src/app/admin/admins/page.tsx index 5bf52e1..05df663 100644 --- a/src/app/admin/admins/page.tsx +++ b/src/app/admin/admins/page.tsx @@ -348,7 +348,7 @@ export default function Admins() { open={openModal} onOpenChange={(isOpen) => { if (!isOpen) { - setOpen(false); + setOpenModal(false); } }} trigger={ diff --git a/src/app/admin/organizations/page.tsx b/src/app/admin/organizations/page.tsx index 6a23f0d..a5fc92e 100644 --- a/src/app/admin/organizations/page.tsx +++ b/src/app/admin/organizations/page.tsx @@ -1,10 +1,8 @@ -import Link from "next/link"; export default function Organizations (){ return ( <> - Organization Profile ) } \ No newline at end of file diff --git a/src/components/floatingLabelInput.tsx b/src/components/floatingLabelInput.tsx index 0ce83cb..b9f87fb 100644 --- a/src/components/floatingLabelInput.tsx +++ b/src/components/floatingLabelInput.tsx @@ -37,7 +37,7 @@ export default function FloatingLabelInput({ defaultValue={defaultValue} > {options?.map((option, index) => ( - + ))} {button &&
{button}
} diff --git a/src/schema/index.ts b/src/schema/index.ts index 4d4c298..4570ae1 100644 --- a/src/schema/index.ts +++ b/src/schema/index.ts @@ -10,5 +10,11 @@ export const adminSchema = z.object({ last_name: z.string(), first_name: z.string(), email: z.string().min(1, "L'email est requis").email("Email invalide"), - organization: z.string().optional(), -}); \ No newline at end of file +}); + +export const companySchema = z.object({ + name: z.string().min(1, "Le nom est requis"), + description: z.string(), + status: z.string(), + owner: z.string() +}) diff --git a/src/types/index.ts b/src/types/index.ts index 4733e04..bc1ac0b 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,11 +1,15 @@ import { FormEventHandler, ReactNode } from "react"; import { ZodSchema } from "zod"; +export interface Option { + label: string + value: string +} export interface FloatingLabelInputProps { label?: string; placeholder?: string; - type: 'text' | 'password' | 'select' | 'email' | 'number' | 'hidden' | 'search'; - options?: string[]; + type: 'text' | 'password' | 'select' | 'email' | 'number' | 'hidden' | 'search' | 'textarea'; + options?: Option[]; button?: React.ReactNode; showPasswordToggle?: boolean; name: string;