mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-28 14:24:26 +00:00
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>
49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
import { Card, CardBody, CardHeader } from "@heroui/card";
|
|
|
|
import { MembershipDetailData, TenantDetailData } from "@/types/users";
|
|
|
|
import { MembershipItem } from "./membership-item";
|
|
|
|
export const MembershipsCard = ({
|
|
memberships,
|
|
tenantsMap,
|
|
isOwner,
|
|
}: {
|
|
memberships: MembershipDetailData[];
|
|
tenantsMap: Record<string, TenantDetailData>;
|
|
isOwner: boolean;
|
|
}) => {
|
|
return (
|
|
<Card className="dark:bg-prowler-blue-400">
|
|
<CardHeader className="gap-2">
|
|
<div className="flex flex-col gap-1">
|
|
<h4 className="text-lg font-bold">Organizations</h4>
|
|
<p className="text-xs text-gray-500">
|
|
Organizations this user is associated with
|
|
</p>
|
|
</div>
|
|
</CardHeader>
|
|
<CardBody>
|
|
{memberships.length === 0 ? (
|
|
<div className="text-sm text-gray-500">No memberships found.</div>
|
|
) : (
|
|
<div className="flex flex-col gap-2">
|
|
{memberships.map((membership) => {
|
|
const tenantId = membership.relationships.tenant.data.id;
|
|
return (
|
|
<MembershipItem
|
|
key={membership.id}
|
|
membership={membership}
|
|
tenantId={tenantId}
|
|
tenantName={tenantsMap[tenantId]?.attributes.name}
|
|
isOwner={isOwner}
|
|
/>
|
|
);
|
|
})}
|
|
</div>
|
|
)}
|
|
</CardBody>
|
|
</Card>
|
|
);
|
|
};
|