2026-10-23 19:56:38 -07:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
|
|
export interface ClientListItem {
|
|
|
|
|
clientId: string;
|
|
|
|
|
name: string;
|
|
|
|
|
status: 'active' | 'revoked';
|
|
|
|
|
totalEvents: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface ClientListProps {
|
|
|
|
|
clients: ClientListItem[];
|
|
|
|
|
limit?: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const ClientList: React.FC<ClientListProps> = ({ clients, limit = 4 }) => (
|
|
|
|
|
<div className="divide-y divide-[var(--border)]">
|
|
|
|
|
{clients.slice(0, limit).map((client) => (
|
2026-11-16 21:58:18 +06:00
|
|
|
<div key={client.clientId} className="flex min-w-0 items-center justify-between gap-2.5 px-3 py-1.5">
|
2026-10-23 19:56:38 -07:00
|
|
|
<div className="flex min-w-0 items-center gap-2">
|
|
|
|
|
<span className={client.status === 'active' ? 'h-1.5 w-1.5 shrink-0 bg-[var(--accent)]' : 'h-1.5 w-1.5 shrink-0 bg-[var(--text-faint)]'} />
|
|
|
|
|
<div className="min-w-0">
|
2026-11-16 21:58:18 +06:00
|
|
|
<p className="truncate text-[11.5px] font-medium text-[var(--text)]">{client.name}</p>
|
2026-10-23 19:56:38 -07:00
|
|
|
<p className="truncate font-mono text-[10px] text-[var(--text-faint)]">{client.clientId}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-11-16 21:58:18 +06:00
|
|
|
<span className="shrink-0 font-mono text-[10.5px] tabular-nums text-[var(--text-muted)]">
|
2026-10-23 19:56:38 -07:00
|
|
|
{client.totalEvents.toLocaleString()}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
{clients.length === 0 && (
|
2026-11-16 21:58:18 +06:00
|
|
|
<p className="px-3 py-4 text-[11px] text-[var(--text-faint)]">No clients</p>
|
2026-10-23 19:56:38 -07:00
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export default ClientList;
|