import { Box, Button, Chip, Typography } from '@mui/material' import { MatchStatusBadge } from './MatchStatusBadge' import type { Match } from '../../domain/match' import type { Property } from '../../domain/property' import type { Need } from '../../domain/need' import { matchScoreHex } from '../../lib/utils' const STRENGTH_META: Record = { STRONG: { label: 'Stark', bg: '#f0fdf4', color: '#1a7a4a' }, MODERATE: { label: 'Mittel', bg: '#fefce8', color: '#d97706' }, WEAK: { label: 'Schwach', bg: '#fff1f2', color: '#c0392b' }, } interface Props { match: Match property: Property | undefined need: Need | undefined onSelect: () => void onApprove: () => void } export function MatchListCard({ match, property, need, onSelect, onApprove }: Props) { const strength = STRENGTH_META[match.matchStrength] ?? { label: match.matchStrength, bg: '#f1f5f9', color: '#64748b' } const summary = match.explainabilitySummary ?? '' return ( {/* Score bubble */} {match.matchScore} {/* Property + need */} {property?.title ?? match.propertyId} {[property?.location.city, property?.areaSqm ? `${property.areaSqm} m²` : null].filter(Boolean).join(' · ')} {need && ( )} {/* Summary excerpt */} {summary && ( {summary.length > 90 ? summary.slice(0, 90) + '…' : summary} )} {/* Actions */} e.stopPropagation()}> {match.status !== 'APPROVED' && ( )} ) }