"use client"; /** * Shared search result rendering (TASK-0098) — ONE result model for both * surfaces: the ⌘K dialog and the /w/:workspace/search page. * * The e2e contract (tests/e2e/specs/search.spec.ts, PINNED — do not rename): * row data-testid="search-result" (the ); } function cnRow(compact: boolean): string { return compact ? "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-accent focus-visible:bg-accent focus-visible:outline-none" : "flex w-full items-start gap-2.5 px-3 py-2.5 text-left hover:bg-muted/50 focus-visible:bg-muted/50 focus-visible:outline-none"; } /** * Grouped results (fixed type order) — the dialog's results section and the * search page's body both render through this. */ export function ResultsList({ items, workspaceSlug, onActivate, compact = false }: { items: readonly SearchResult[]; workspaceSlug: string | null; onActivate?: (item: SearchResult) => void; compact?: boolean; }) { const groups: SearchGroup[] = groupResultsByType(items); if (groups.length === 0) return null; return (
{groups.map((group) => (

{group.label} ({group.items.length})

))}
); }