da50f3b5ea
- 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>
117 lines
3.3 KiB
TypeScript
117 lines
3.3 KiB
TypeScript
import { Box, Paper, Typography } from '@mui/material'
|
|
import { Building2 } from 'lucide-react'
|
|
import type { Inquiry } from '../../domain/inquiry'
|
|
import { formatInquiryDate, propertyLabelFromId } from './inquiryUtils'
|
|
|
|
interface InquiryCardProps {
|
|
inquiry: Inquiry
|
|
selected: boolean
|
|
onClick: () => void
|
|
}
|
|
|
|
export function InquiryCard({ inquiry, selected, onClick }: InquiryCardProps) {
|
|
const hasUnread = !inquiry.isRead && inquiry.unreadCount > 0
|
|
|
|
return (
|
|
<Paper
|
|
onClick={onClick}
|
|
elevation={0}
|
|
sx={{
|
|
p: 2,
|
|
borderRadius: 1.5,
|
|
border: '1px solid',
|
|
borderColor: selected ? '#152642' : '#e8e7e4',
|
|
bgcolor: selected ? '#f1f5f9' : 'white',
|
|
cursor: 'pointer',
|
|
transition: 'all 0.15s',
|
|
'&:hover': {
|
|
borderColor: selected ? '#152642' : '#94a3b8',
|
|
boxShadow: '0 2px 6px rgba(15,23,42,0.06)',
|
|
},
|
|
display: 'flex',
|
|
flexDirection: 'column',
|
|
gap: 0.75,
|
|
minHeight: 160,
|
|
}}
|
|
>
|
|
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 1 }}>
|
|
<Typography
|
|
variant="body2"
|
|
sx={{
|
|
fontWeight: hasUnread ? 700 : 600,
|
|
color: '#0f172a',
|
|
fontSize: '0.85rem',
|
|
lineHeight: 1.3,
|
|
}}
|
|
>
|
|
{inquiry.tenantName}
|
|
{inquiry.tenantCompany ? ` · ${inquiry.tenantCompany}` : ''}
|
|
</Typography>
|
|
{hasUnread && (
|
|
<Box
|
|
sx={{
|
|
minWidth: 20,
|
|
height: 20,
|
|
borderRadius: '50%',
|
|
bgcolor: '#2563eb',
|
|
color: 'white',
|
|
fontSize: '0.65rem',
|
|
fontWeight: 700,
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
flexShrink: 0,
|
|
px: inquiry.unreadCount > 9 ? 0.75 : 0,
|
|
}}
|
|
>
|
|
{inquiry.unreadCount}
|
|
</Box>
|
|
)}
|
|
</Box>
|
|
|
|
<Typography
|
|
variant="body2"
|
|
sx={{
|
|
fontWeight: hasUnread ? 600 : 500,
|
|
color: '#1e293b',
|
|
fontSize: '0.85rem',
|
|
display: '-webkit-box',
|
|
WebkitLineClamp: 2,
|
|
WebkitBoxOrient: 'vertical',
|
|
overflow: 'hidden',
|
|
}}
|
|
>
|
|
{inquiry.subject}
|
|
</Typography>
|
|
|
|
<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.75, color: '#64748b' }}>
|
|
<Building2 size={13} />
|
|
<Typography variant="caption" sx={{ fontSize: '0.75rem' }}>
|
|
{propertyLabelFromId(inquiry.propertyId)}
|
|
</Typography>
|
|
</Box>
|
|
|
|
<Box sx={{ mt: 'auto', display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
|
<Typography variant="caption" sx={{ color: '#94a3b8', fontSize: '0.7rem' }}>
|
|
{formatInquiryDate(inquiry.createdAt)}
|
|
</Typography>
|
|
{inquiry.matchScore !== undefined && (
|
|
<Box
|
|
sx={{
|
|
px: 1,
|
|
py: 0.25,
|
|
borderRadius: 1,
|
|
bgcolor: '#e0e7ff',
|
|
color: '#3730a3',
|
|
fontWeight: 600,
|
|
fontSize: '0.7rem',
|
|
}}
|
|
>
|
|
Match {inquiry.matchScore}%
|
|
</Box>
|
|
)}
|
|
</Box>
|
|
</Paper>
|
|
)
|
|
}
|