/** * TenantCard Component * * Card view for individual tenant display in grid layout. * Alternative to table view for better visual hierarchy and mobile responsiveness. * * Features: * - Compact card layout * - Status badge * - Integration keys count * - Edit/Delete actions * - Hover effects * - Clickable card * * @component * @layer Presentation */ import { Edit, Trash2, Building2, Globe, Key } from 'lucide-react'; import type { Tenant } from '@domain/entities'; import { TenantStatus } from '@domain/entities'; import { TENANT_STATUS_CONFIG } from '@domain/constants'; interface TenantCardProps { /** Tenant data */ tenant: Tenant; /** Company name for display */ companyName: string; /** Edit handler */ onEdit: (tenant: Tenant) => void; /** Delete handler */ onDelete: (tenant: Tenant) => void; } /** * Status Badge Component */ function StatusBadge({ status }: { status: TenantStatus }) { const config = TENANT_STATUS_CONFIG[status]; const colorClasses: Record = { green: 'bg-green-100 text-green-800 border-green-200', yellow: 'bg-yellow-100 text-yellow-800 border-yellow-200', gray: 'bg-gray-100 text-gray-700 border-gray-200', }; // Extract color name from config.color (e.g., "text-green-600" -> "green") const colorName = config.color.split('-')[1] || 'gray'; return ( {config.label} ); } /** * TenantCard Component */ export function TenantCard({ tenant, companyName, onEdit, onDelete }: TenantCardProps) { return (
{/* Header */}
{/* Name with Icon Badge */}

{tenant.name}

{/* Domain */} e.stopPropagation()} > {tenant.domain} {/* Status Badge */}
{/* Body */}
{/* Company */}
Company: {companyName}
{/* Integration Keys */}
Integration Keys:
{tenant.integrationKeysCount}
{/* Footer - Actions */}
); }