"use client"; import { FileText, ExternalLink, Star, Database, Globe } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; interface SourceReference { title: string; filename?: string; page?: number; score?: number; preview: string; url?: string; source_type?: "web" | "rag"; } interface SourceReferencesProps { sources: SourceReference[]; maxSources?: number; } export default function SourceReferences({ sources, maxSources = 5 }: SourceReferencesProps) { if (!sources || sources.length === 0) { return null; } const displaySources = sources.slice(0, maxSources); const ragSources = displaySources.filter(s => s.source_type !== "web"); const webSources = displaySources.filter(s => s.source_type === "web"); return (
{source.preview}
{source.preview}
{source.url && ( )}