mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-18 18:11:57 +00:00
4d5676f00e
Co-authored-by: Alan Buscaglia <alanbuscaglia@MacBook-Pro.local> Co-authored-by: alejandrobailo <alejandrobailo94@gmail.com> Co-authored-by: César Arroba <cesar@prowler.com> Co-authored-by: Alejandro Bailo <59607668+alejandrobailo@users.noreply.github.com>
66 lines
2.1 KiB
TypeScript
66 lines
2.1 KiB
TypeScript
"use client";
|
|
|
|
import { Card, CardBody } from "@heroui/card";
|
|
import { Divider } from "@heroui/divider";
|
|
|
|
import { DateWithTime, InfoField, SnippetChip } from "@/components/ui/entities";
|
|
import { UserDataWithRoles } from "@/types/users";
|
|
|
|
import { ProwlerShort } from "../../icons";
|
|
|
|
const TenantIdCopy = ({ id }: { id: string }) => {
|
|
return (
|
|
<div className="flex items-center gap-2 whitespace-nowrap md:flex-col md:items-start md:justify-start">
|
|
<SnippetChip value={id} />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export const UserBasicInfoCard = ({
|
|
user,
|
|
tenantId,
|
|
}: {
|
|
user: UserDataWithRoles;
|
|
tenantId: string;
|
|
}) => {
|
|
const { name, email, company_name, date_joined } = user.attributes;
|
|
|
|
return (
|
|
<Card className="dark:bg-prowler-blue-400">
|
|
<CardBody>
|
|
<div className="flex items-center gap-4">
|
|
<div className="flex h-10 w-10 items-center justify-center rounded-full border-3 border-black p-1 dark:border-white">
|
|
<ProwlerShort />
|
|
</div>
|
|
<div className="flex flex-col">
|
|
<span className="text-md font-bold">{name}</span>
|
|
<span className="text-xs font-light">
|
|
{email}
|
|
{company_name && ` | ${company_name}`}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<Divider className="my-4" />
|
|
<div className="flex flex-row gap-4 md:items-start md:justify-start md:gap-8">
|
|
<div className="flex gap-2 whitespace-nowrap md:flex-col md:items-start md:justify-start">
|
|
<div className="flex items-center gap-2">
|
|
<InfoField label="Date Joined" variant="simple">
|
|
<DateWithTime inline dateTime={date_joined} />
|
|
</InfoField>
|
|
</div>
|
|
</div>
|
|
<div className="flex flex-col gap-2">
|
|
<InfoField label="Organization ID" variant="transparent">
|
|
{tenantId ? (
|
|
<TenantIdCopy id={tenantId} />
|
|
) : (
|
|
<span className="text-xs font-light">No organization</span>
|
|
)}
|
|
</InfoField>
|
|
</div>
|
|
</div>
|
|
</CardBody>
|
|
</Card>
|
|
);
|
|
};
|