import { DashboardSection } from "./DashboardSection"; import { DashboardEmptyState } from "./DashboardEmptyState"; type SessionSummary = { key: string; title: string; subtitle: string; usage: string; lastSeenAt: string | null; isMain: boolean; }; interface SessionsSectionProps { sessions: SessionSummary[]; activeSessions: number; hasConfiguredGateways: boolean; isLoading: boolean; gatewayUnavailableCount: number; gatewayTargetsCount: number; formatCount: (n: number) => string; formatRelative: (ts: string) => string; dash: string; } export function SessionsSection({ sessions, activeSessions, hasConfiguredGateways, isLoading, gatewayUnavailableCount, gatewayTargetsCount, formatCount, formatRelative, dash, }: SessionsSectionProps) { return (
{!hasConfiguredGateways ? ( ) : isLoading ? ( ) : sessions.length > 0 ? ( <> {gatewayUnavailableCount > 0 && ( )} {sessions.map((session) => (

{session.title}

{session.subtitle}

{session.usage === dash ? "Usage unavailable" : session.usage}

{session.lastSeenAt ? formatRelative(session.lastSeenAt) : "Activity unavailable"}

))} ) : gatewayUnavailableCount === gatewayTargetsCount ? ( ) : ( )}
); }