import React from 'react'; import { Document } from '../../../shared/types'; interface Props { documents: Document[]; onSelect: (doc: Document) => void; selectedId: string | null; } export function DocumentList({ documents, onSelect, selectedId }: Props) { if (documents.length === 0) { return (
No documents imported yet.
Import documents to get started.
); } return (
{documents.map(doc => (
onSelect(doc)} style={{ padding: '10px 16px', cursor: 'pointer', borderBottom: '1px solid #0f3460', background: selectedId === doc.id ? '#0f3460' : 'transparent', transition: 'background 0.15s', }} >
{doc.title}
{doc.status === 'indexed' ? '✓ ' : ''} {(doc.size / 1024).toFixed(1)} KB
))}
); }