mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-22 12:01:54 +00:00
c281f85742
* feat(users): Add in Add User modal, add in Label component * feat(users): Make adjustments to Add User modal and Edit user modal * feat(users): Populate data from mock API * feat(users): Permissions - do not show team info to users, redirect users
63 lines
1.7 KiB
TypeScript
63 lines
1.7 KiB
TypeScript
"use client";
|
|
|
|
import { Button, Input } from "@nextui-org/react";
|
|
import { useRef, useState } from "react";
|
|
|
|
import {
|
|
Dialog,
|
|
DialogContent,
|
|
DialogHeader,
|
|
DialogTitle,
|
|
DialogTrigger,
|
|
} from "@/components/ui";
|
|
|
|
import { ButtonAddUser } from "./ButtonAddUser";
|
|
import { CustomSelectUser } from "./CustomSelectUser";
|
|
|
|
export const AddUserModal = () => {
|
|
const [open, setOpen] = useState(false);
|
|
const ref = useRef<HTMLFormElement>(null);
|
|
|
|
return (
|
|
<Dialog open={open} onOpenChange={setOpen}>
|
|
<DialogTrigger asChild>
|
|
<Button aria-label="Add User" variant="ghost">
|
|
Add User
|
|
</Button>
|
|
</DialogTrigger>
|
|
<DialogContent
|
|
aria-describedby={undefined}
|
|
className="flex flex-col sm:max-w-md md:max-w-lg"
|
|
>
|
|
<DialogHeader className="mb-6 space-y-3">
|
|
<DialogTitle className="text-2xl text-center">Add User</DialogTitle>
|
|
</DialogHeader>
|
|
<form ref={ref} onSubmit={() => setOpen(false)}>
|
|
<div className="col-span-1 flex flex-col gap-y-2 my-auto">
|
|
<Input
|
|
type="text"
|
|
name="email"
|
|
label="Email"
|
|
labelPlacement="outside"
|
|
placeholder="Email"
|
|
aria-label="Enter Email"
|
|
size="md"
|
|
radius="md"
|
|
isRequired
|
|
fullWidth
|
|
classNames={{
|
|
base: "h-12 mb-4",
|
|
inputWrapper: "h-full",
|
|
}}
|
|
/>
|
|
<CustomSelectUser />
|
|
</div>
|
|
<div className="col-span-2 flex justify-center mt-4">
|
|
<ButtonAddUser />
|
|
</div>
|
|
</form>
|
|
</DialogContent>
|
|
</Dialog>
|
|
);
|
|
};
|