refactor: GenericBadge + Provider-Isolation
Teil A — GenericBadge:
- Neue src/components/shared/GenericBadge.tsx mit zwei Varianten:
transparent (${color}18 Hintergrund, farbiger Text, opt. Border)
solid (gefüllte Farbe, weisser Text)
- Props: label, color, variant, showBorder, bold, icon, size, tooltip, ariaLabel
- 7 Badges auf GenericBadge refactored (Config-Objekt + 1-Zeiler):
ReviewStatusBadge, ReviewPriorityBadge, ReviewEntityTypeBadge,
AIOutputStatusBadge, AIErrorBadge, MatchStatusBadge, ShortlistStatusBadge
- Barrel-Export in src/components/shared/index.ts
Teil B — Provider-Isolation:
- src/mock-data/propertyStore.ts als neutrales Daten-Modul erstellt
- MockupPropertyProvider: importiert aus mock-data statt selbst zu definieren
- MockupUnitProvider: importiert aus mock-data statt aus MockupPropertyProvider
- matchSyncService: importiert aus mock-data statt aus MockupPropertyProvider
- Kein Provider importiert mehr einen anderen Provider
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Chip, Tooltip } from '@mui/material'
|
||||
import { GenericBadge } from '../shared/GenericBadge'
|
||||
import type { AIOutputError } from '../../domain/aiOutput'
|
||||
|
||||
const ERROR_CONFIG: Record<string, { label: string; color: string }> = {
|
||||
@@ -11,13 +11,5 @@ const ERROR_CONFIG: Record<string, { label: string; color: string }> = {
|
||||
|
||||
export function AIErrorBadge({ error }: { error: AIOutputError }) {
|
||||
const { label, color } = ERROR_CONFIG[error.type] ?? { label: error.type, color: '#c0392b' }
|
||||
return (
|
||||
<Tooltip title={error.message} arrow>
|
||||
<Chip
|
||||
size="small"
|
||||
label={label}
|
||||
sx={{ bgcolor: `${color}18`, color, fontWeight: 700, fontSize: '0.65rem', cursor: 'default' }}
|
||||
/>
|
||||
</Tooltip>
|
||||
)
|
||||
return <GenericBadge label={label} color={color} bold tooltip={error.message} />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user