'use client' import { useState } from 'react' import type { IngestionStatus } from './types' import { API_BASE } from './types' export function IngestionTab({ status, onRefresh, }: { status: IngestionStatus | null onRefresh: () => void }) { const [starting, setStarting] = useState(false) const startIngestion = async () => { setStarting(true) try { await fetch(`${API_BASE}/api/v1/admin/nibis/ingest`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ ewh_only: true }), }) onRefresh() } catch (err) { console.error('Failed to start ingestion:', err) } finally { setStarting(false) } } return (
Übersicht über laufende und vergangene Indexierungsvorgänge
Letzte Ausführung
{status.lastRun ? new Date(status.lastRun).toLocaleString('de-DE') : '-'}
Dokumente
{status.documentsIndexed ?? '-'}
Chunks
{status.chunksCreated ?? '-'}
Fehler
0 ? 'text-red-600' : 'text-slate-900'}`}>{status.errors.length}