import { useEffect } from 'react'; import type { Source } from '../types'; interface SourceModalProps { source: Source; onClose: () => void; } export function SourceModal({ source, onClose }: SourceModalProps) { useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { if (e.key === 'Escape') onClose(); }; window.addEventListener('keydown', handleKeyDown); return () => window.removeEventListener('keydown', handleKeyDown); }, [onClose]); return (
e.stopPropagation()}>

{source.filename}

Chunk {source.chunk_index + 1}
{source.content}
); }