Files
property-match/src/components/shortlist/ShortlistCard.tsx
T
Benjamin Sutter 65130efca7 feat: F015 shortlist management
3-panel Shortlists page with left list, center detail, right decision brief panel. AddToShortlistDialog wired into result feed cards and match detail. Full DRAFT→REVIEW_READY→FINALIZED workflow, AI-generated decision brief draft, duplicate prevention, and compare-view integration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 21:10:06 +02:00

45 lines
1.7 KiB
TypeScript

import { Box, Chip, Typography } from '@mui/material'
import { ShortlistStatusBadge } from './ShortlistStatusBadge'
import { useShortlistStore } from '../../stores/shortlistStore'
import type { Shortlist } from '../../domain/shortlist'
interface Props {
shortlist: Shortlist
}
export function ShortlistCard({ shortlist }: Props) {
const { selectedShortlistId, setSelectedShortlist } = useShortlistStore()
const isSelected = selectedShortlistId === shortlist.id
const updatedDate = new Date(shortlist.updatedAt).toLocaleDateString('de-CH', { day: '2-digit', month: '2-digit', year: 'numeric' })
return (
<Box
onClick={() => setSelectedShortlist(isSelected ? null : shortlist.id)}
sx={{
p: 1.5,
cursor: 'pointer',
borderBottom: '1px solid #f1f5f9',
borderLeft: isSelected ? '3px solid #1e3a5f' : '3px solid transparent',
bgcolor: isSelected ? '#eff6ff' : 'transparent',
'&:hover': { bgcolor: isSelected ? '#eff6ff' : '#f8fafc' },
}}
>
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', mb: 0.5, gap: 0.5 }}>
<Typography variant="body2" sx={{ fontWeight: 600, lineHeight: 1.3, flex: 1 }}>
{shortlist.title}
</Typography>
<Chip
label={shortlist.items.length}
size="small"
sx={{ bgcolor: '#e2e8f0', color: '#475569', fontSize: 10, height: 18, minWidth: 22, flexShrink: 0 }}
/>
</Box>
<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.75, flexWrap: 'wrap' }}>
<ShortlistStatusBadge status={shortlist.status} />
<Typography variant="caption" color="text.secondary">{updatedDate}</Typography>
</Box>
</Box>
)
}