import { Alert, Box, Button, Chip, Paper, Typography } from '@mui/material' import { ArrowLeft, Bookmark, Columns2 } from 'lucide-react' import { MatchScoreDisplay } from '../match-card/MatchScoreDisplay' import type { Match } from '../../domain/match' import type { Property } from '../../domain/property' import type { FutureSignal } from '../../domain/futureSignal' const RESULT_TYPE_META: Record = { VERIFIED_PORTFOLIO: { label: 'Verified Portfolio', color: '#152642' }, MAISON_WORK: { label: 'Maison Work', color: '#0369a1' }, FUTURE_AVAILABILITY: { label: 'Zukunftssignal', color: '#7c3aed' }, } function confColor(c: number): string { return c >= 0.75 ? '#1a7a4a' : c >= 0.55 ? '#d97706' : '#c0392b' } function dqColor(q: number): string { return q >= 0.80 ? '#1a7a4a' : q >= 0.60 ? '#d97706' : '#c0392b' } interface Props { match: Match property: Property | null signal: FutureSignal | null onBack: () => void onCompare: () => void onShortlist: () => void } export function MatchDetailHeader({ match, property, signal, onBack, onCompare, onShortlist }: Props) { const rt = RESULT_TYPE_META[match.resultType ?? 'VERIFIED_PORTFOLIO'] ?? { label: '–', color: '#64748b' } const title = property?.title ?? signal?.companyName ?? signal?.locationHint ?? '–' const isFuture = match.resultType === 'FUTURE_AVAILABILITY' const dqScore = property?.dataQuality?.score ?? signal?.confidenceScore ?? 0.5 const confPct = Math.round(match.confidenceLevel * 100) const dqPct = Math.round(dqScore * 100) const location = property?.location?.city ? `${property.location.city}${property.location.district ? `, ${property.location.district}` : ''}` : signal?.locationHint ?? '–' const source = property?.sourceLabel ?? property?.sourceMeta?.sourceLabel ?? '–' const availability = property?.availabilityDate ?? (signal?.timeHorizonMonths ? `~${signal.timeHorizonMonths} Monate` : undefined) return ( {isFuture && ( Probabilistisches Signal – keine bestätigte Fläche. Alle Angaben sind Schätzungen. )} {title} {location} {property?.assetType && ( )} {availability && } {source !== '–' && ( Quelle: {source} )} ) }