import type { SourceReference } from '@/types/rag'; import { FileText, ExternalLink } from 'lucide-react'; import { useState } from 'react'; import { cn } from '@/lib/utils'; interface SourceListProps { sources: SourceReference[]; onSourceClick: (path: string) => void; } export function SourceList({ sources, onSourceClick }: SourceListProps) { const [expanded, setExpanded] = useState(false); if (!sources || sources.length === 0) return null; const displayedSources = expanded ? sources : sources.slice(0, 3); const hasMore = sources.length > 3; return (

Sources

{displayedSources.map((source, i) => ( ))} {hasMore && !expanded && ( )}
); }