feat: add organizations data-table page

This commit is contained in:
Orace.A 2025-03-27 21:24:50 +01:00 committed by Ruben
parent c7489f6a23
commit 0f8267a984
5 changed files with 16 additions and 8 deletions

View File

@ -348,7 +348,7 @@ export default function Admins() {
open={openModal}
onOpenChange={(isOpen) => {
if (!isOpen) {
setOpen(false);
setOpenModal(false);
}
}}
trigger={

View File

@ -1,10 +1,8 @@
import Link from "next/link";
export default function Organizations (){
return (
<>
<Link href="/admin/organizations/971ff270-6253-4424-b100-21b9ebf0ec7f">Organization Profile</Link>
</>
)
}

View File

@ -37,7 +37,7 @@ export default function FloatingLabelInput({
defaultValue={defaultValue}
>
{options?.map((option, index) => (
<option key={index} value={option}>{option}</option>
<option key={index} value={option.value}>{option.label}</option>
))}
</select>
{button && <div className="btn-floating-right">{button}</div>}

View File

@ -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(),
});
});
export const companySchema = z.object({
name: z.string().min(1, "Le nom est requis"),
description: z.string(),
status: z.string(),
owner: z.string()
})

View File

@ -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;