'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 (

Ingestion Status

Übersicht über laufende und vergangene Indexierungsvorgänge

{status?.running ? (
) : (
)} {status?.running ? 'Indexierung läuft...' : 'Bereit'}
{status && (

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}

)} {status?.errors && status.errors.length > 0 && (

Fehler

    {status.errors.slice(0, 5).map((error, i) => (
  • {error}
  • ))} {status.errors.length > 5 && (
  • ... und {status.errors.length - 5} weitere
  • )}
)}
) }