import Box from '@mui/material/Box'; import { getQualityMetrics, getPipeline, usePoll } from '../services/labeleval'; import { useLabelEval } from '../context/LabelEvalContext'; import LabelEvaluationEngine from '../components/labeleval/LabelEvaluationEngine'; import StrictQualityValidation from '../components/labeleval/StrictQualityValidation'; import GroundTruthComparison from '../components/labeleval/GroundTruthComparison'; import GraderDisagreement from '../components/labeleval/GraderDisagreement'; import { LoadingBox, ErrorNote } from '../components/labeleval/shared'; export default function QualityEnginePage() { const { activeDatasetId, stream } = useLabelEval(); const metrics = usePoll(() => getQualityMetrics(activeDatasetId), 5000, [activeDatasetId]); // Use the stream's pipeline state when available; otherwise poll. const pipelinePoll = usePoll(getPipeline, stream ? null : 3000, [stream === null]); const pipeline = stream?.pipeline ?? pipelinePoll.data; return ( {metrics.loading && !metrics.data ? : null} {metrics.error && !metrics.data ? : null} ); }