/** * UserStatusDisplay * * Deterministic mapping of user status codes to display labels and variants. */ export class UserStatusFormatter { /** * Maps user status to display label. */ static statusLabel(status: string): string { const map: Record = { active: 'Active', suspended: 'Suspended', deleted: 'Deleted', }; return map[status] || status; } /** * Maps user status to badge variant. */ static statusVariant(status: string): string { const map: Record = { active: 'performance-green', suspended: 'yellow-500', deleted: 'racing-red', }; return map[status] || 'gray-500'; } /** * Determines if a user can be suspended. */ static canSuspend(status: string): boolean { return status === 'active'; } /** * Determines if a user can be activated. */ static canActivate(status: string): boolean { return status === 'suspended'; } /** * Determines if a user can be deleted. */ static canDelete(status: string): boolean { return status !== 'deleted'; } }