Files
property-match/src/components/match-card/MatchCardCompareMini.tsx
T
Benjamin Sutter da50f3b5ea feat: premium redesign — DM Serif, refined palette, flat score badges
- Design tokens (ds.ts, theme.ts, scoreTheme.ts): new warm palette
  (#152642 navy, #f9f8f6 warm white, #e8e7e4 borders, #b8975a gold accent),
  flat score tier badges replacing CSS gradients, Inter + DM Serif Display typography
- Card components: white-background cards, DM Serif score numbers, max-2 badge
  chips with +N overflow tooltip, editorial score badge positioning
- Layout shell: gold left-accent nav active state, 64px top bar, outlined
  workspace chip, DM Serif page titles
- Shared atoms: GenericBadge (outlined/solid variants), ResultFilterBar
  (simplified chip styles), DecisionContextPanel (dot metrics, no left accent)
- Global replacement (118 files): #1e3a5f→#152642, #e2e8f0→#e8e7e4,
  #f4f6f9→#f9f8f6 — all handled via Node.js for proper UTF-8 safety

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 22:26:30 +02:00

69 lines
2.1 KiB
TypeScript

import { Box, Card, Chip, Divider, IconButton, Typography } from '@mui/material'
import { X } from 'lucide-react'
import { MatchScoreDisplay } from './MatchScoreDisplay'
import type { MatchCardViewModel } from './MatchCardViewModel'
const RESULT_TYPE_META: Record<string, { label: string; color: string }> = {
VERIFIED_PORTFOLIO: { label: 'Verified', color: '#152642' },
MAISON_WORK: { label: 'Maison Work', color: '#0369a1' },
FUTURE_AVAILABILITY: { label: 'Signal', color: '#7c3aed' },
}
interface Props {
vm: MatchCardViewModel
onRemove?: () => void
}
export function MatchCardCompareMini({ vm, onRemove }: Props) {
const rt = RESULT_TYPE_META[vm.resultType] ?? { label: vm.resultType, color: '#64748b' }
const topReason = vm.reasons[0]
return (
<Card sx={{ p: 1.5, minWidth: 180, maxWidth: 220, position: 'relative', flexShrink: 0 }}>
{onRemove && (
<IconButton
size="small"
onClick={onRemove}
sx={{ position: 'absolute', top: 4, right: 4, p: 0.25 }}
>
<X size={14} />
</IconButton>
)}
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 0.5, pr: 2 }}>
<MatchScoreDisplay score={vm.matchScore} size="sm" />
<Chip
label={rt.label}
size="small"
sx={{ bgcolor: rt.color, color: 'white', fontSize: 10, height: 18 }}
/>
</Box>
<Typography variant="caption" sx={{ fontWeight: 600, display: 'block' }} noWrap>
{vm.title}
</Typography>
<Typography variant="caption" color="text.secondary" noWrap>
{vm.locationLabel}
</Typography>
{topReason && (
<>
<Divider sx={{ my: 0.75 }} />
<Typography
variant="caption"
color="text.secondary"
sx={{
display: '-webkit-box',
overflow: 'hidden',
WebkitLineClamp: 2,
WebkitBoxOrient: 'vertical',
}}
>
{topReason.explanation}
</Typography>
</>
)}
</Card>
)
}