d15a13e485
- Delete all ops page components (ReviewQueue, AIMonitoring, Governance, SourceMonitoring, ActivityTimeline, SignalPipeline) - Remove OPERATIONS workspace from AppShell config, nav order, path detection - Remove all /ops/* routes from App.tsx - Remove WorkspaceType.OPERATIONS from allowedWorkspaces in authService, sessionStore, permissions - Keep MarketIntelligence page (already moved to /supply/market-intelligence) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
45 lines
1.4 KiB
TypeScript
45 lines
1.4 KiB
TypeScript
import { Chip } from '@mui/material'
|
|
import { CheckCircle2, AlertTriangle, XCircle } from 'lucide-react'
|
|
import type { DataQualityLevel } from '../../domain/enums'
|
|
import { DS_COLORS, scoreToDataQualityLevel } from '../../lib/ds'
|
|
import { DATA_QUALITY_LABELS } from '../../lib/constants'
|
|
|
|
interface DataQualityBadgeProps {
|
|
level?: DataQualityLevel
|
|
score?: number
|
|
showScore?: boolean
|
|
size?: 'small' | 'medium'
|
|
}
|
|
|
|
const ICONS: Record<DataQualityLevel, React.ElementType> = {
|
|
HIGH: CheckCircle2,
|
|
MEDIUM: AlertTriangle,
|
|
LOW: XCircle,
|
|
INCOMPLETE: XCircle,
|
|
}
|
|
|
|
export function DataQualityBadge({ level, score, showScore = false, size = 'small' }: DataQualityBadgeProps) {
|
|
const resolved: DataQualityLevel =
|
|
level ?? (score !== undefined ? scoreToDataQualityLevel(score) : 'LOW')
|
|
const { bg, fg } = DS_COLORS.dataQuality[resolved]
|
|
const Icon = ICONS[resolved]
|
|
const scoreLabel = showScore && score !== undefined ? ` ${Math.round(score * 100)}%` : ''
|
|
const label = `${DATA_QUALITY_LABELS[resolved] ?? resolved}${scoreLabel}`
|
|
return (
|
|
<Chip
|
|
size={size}
|
|
label={label}
|
|
icon={<Icon size={11} color={fg} />}
|
|
aria-label={`Datenqualität: ${label}`}
|
|
sx={{
|
|
bgcolor: bg,
|
|
color: fg,
|
|
border: 'none',
|
|
fontWeight: 600,
|
|
fontSize: '0.7rem',
|
|
'& .MuiChip-icon': { ml: 0.5 },
|
|
}}
|
|
/>
|
|
)
|
|
}
|