diff --git a/src/pages/collection/[collection_id].tsx b/src/pages/collection/[collection_id].tsx index 3e1d4af..492d973 100644 --- a/src/pages/collection/[collection_id].tsx +++ b/src/pages/collection/[collection_id].tsx @@ -24,6 +24,7 @@ import { Entity, Community, Triple, + DocumentInCollectionType, } from '@/types'; const MAX_RETRIES = 5; @@ -264,52 +265,6 @@ const CollectionIdPage: React.FC = () => { setCurrentPage(page); }; - const columns: Column[] = [ - { key: 'title', label: 'Title', sortable: true }, - { key: 'id', label: 'Document ID', truncate: true, copyable: true }, - { - key: 'ingestion_status', - label: 'Ingestion', - filterable: true, - filterType: 'multiselect', - filterOptions: ['success', 'failed', 'pending'], - renderCell: (doc) => ( - - {doc.ingestion_status} - - ), - }, - { - key: 'kg_extraction_status', - label: 'KG Extraction', - filterable: true, - filterType: 'multiselect', - filterOptions: ['success', 'failed', 'pending'], - renderCell: (doc) => ( - - {doc.kg_extraction_status} - - ), - selected: false, - }, - ]; - const renderDocumentActions = (doc: DocumentInfoType) => (
{
); + const documentColumns: Column[] = [ + { key: 'title', label: 'Title', sortable: true }, + { key: 'id', label: 'Document ID', truncate: true, copyable: true }, + { + key: 'ingestion_status', + label: 'Ingestion', + filterable: true, + filterType: 'multiselect', + filterOptions: ['success', 'failed', 'pending'], + renderCell: (doc) => ( + + {doc.ingestion_status} + + ), + }, + { + key: 'kg_extraction_status', + label: 'KG Extraction', + filterable: true, + filterType: 'multiselect', + filterOptions: ['success', 'failed', 'pending'], + renderCell: (doc) => ( + + {doc.kg_extraction_status} + + ), + selected: false, + }, + ]; + const userColumns: Column[] = [ { key: 'id', label: 'User ID', truncate: true, copyable: true }, { key: 'email', label: 'Email', truncate: true, copyable: true }, @@ -500,7 +501,7 @@ const CollectionIdPage: React.FC = () => { { diff --git a/src/types.ts b/src/types.ts index 2e94e9a..caf7835 100644 --- a/src/types.ts +++ b/src/types.ts @@ -162,6 +162,19 @@ export interface DocumentInfoType { updated_at: string; } +export interface DocumentInCollectionType { + id: string; + title: string; + user_id: string; + document_type?: string; + created_at: string; + updated_at: string; + ingestion_status: IngestionStatus; + kg_extraction_status: KGExtractionStatus; + collection_ids: string[]; + metadata: Record; +} + export interface DocumentInfoDialogProps { id: string; apiUrl?: string;