import { Link } from "../../lib/navigation"; import { ChevronRightIcon, PanelsTopLeftIcon } from "lucide-react"; import { RailTrailingMetadata } from "./session-row-content"; import { cn } from "../../lib/utils"; import { visualTreeDepth } from "../../lib/session-rail"; import type { RailAggregateStatus } from "../../lib/sessions-group"; import type { SessionSiteOrigin } from "../../lib/session-site-origin"; /** A Site's row in the rail: open the Site view, or disclose its conversations. */ export function SiteSessionGroupHeading({ origin, workspaceId, expanded, onToggle, summary, count, relativeTime, depth = 0, active = false, }: { origin: SessionSiteOrigin; workspaceId: string; expanded: boolean; onToggle: () => void; summary: RailAggregateStatus; /** Conversations behind the row, loaded or not. */ count: number; relativeTime?: string | undefined; depth?: number | undefined; active?: boolean | undefined; }) { const conversations = `${count} ${count === 1 ? "conversation" : "conversations"}`; // A Site without conversations is a plain row: nothing to disclose. const disclosable = count > 0 || expanded; return (
0 ? { marginLeft: visualTreeDepth(depth) * 12 } : undefined} > {disclosable ? ( ) : null} 0 ? `, ${conversations}. ${summary.label}` : ""}`} className="flex h-full min-w-0 flex-1 items-center gap-1.5 rounded-sm outline-hidden focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:ring-offset-1 focus-visible:ring-offset-surface" >
); }