"use client"; import { useState } from "react"; import type { Citation } from "@/lib/types"; interface Props { citations: Citation[]; } export default function SourcesPanel({ citations }: Props) { const [expanded, setExpanded] = useState(null); if (!citations.length) return null; return (
Sources ({citations.length})
{citations.map((c) => (
{expanded === c.index && (

{c.text}

{c.source_file}

)}
))}
); }