refactor: extract helpers from 3 match-detail/match-card components

- LocationIntelligencePanel (333→275): KpiTile + NEW_PROJECTS → own files
- FutureAvailabilityContextPanel (351→315): constants + utils → own files
- FutureAvailabilityCard (310→244): helpers + SignalQualityDots → own files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Sutter
2026-05-24 01:16:32 +02:00
parent c6055f0611
commit 01c0f8b06f
8 changed files with 158 additions and 166 deletions
@@ -8,65 +8,8 @@ import { useProperties } from '../../hooks/useProperties'
import { getCityIntelligence } from '../../lib/locationIntelligence'
import type { Property } from '../../domain/property'
import { SoftFactorBar } from './SoftFactorBar'
// ── Sub-components ────────────────────────────────────────────────────────────
function KpiTile({
label,
value,
sub,
color,
}: {
label: string
value: string
sub?: string
color?: string
}) {
return (
<Box
sx={{
flex: 1,
p: 1.5,
bgcolor: '#f8fafc',
borderRadius: 1.5,
border: '1px solid #e2e8f0',
minWidth: 100,
}}
>
<Typography variant="caption" color="text.secondary" sx={{ display: 'block', mb: 0.25 }}>
{label}
</Typography>
<Typography variant="subtitle1" sx={{ fontWeight: 700, color: color ?? '#0f1923', lineHeight: 1.2 }}>
{value}
</Typography>
{sub && (
<Typography variant="caption" color="text.secondary">
{sub}
</Typography>
)}
</Box>
)
}
const NEW_PROJECTS: Record<string, { title: string; area: string; completion: string; note: string }[]> = {
'Zürich': [
{ title: 'Ensemble Zürich-West', area: '5002000 m²', completion: 'Q3 2026', note: 'Büroflächen im Neubauprojekt, Kreis 5' },
{ title: 'The Circle Phase II', area: '10005000 m²', completion: 'Q1 2027', note: 'Premium-Büros, Flughafen Zürich' },
],
'Basel': [
{ title: 'Basel SBB Tower', area: '3001500 m²', completion: 'Q4 2026', note: 'Gemischte Nutzung, zentrale Lage' },
{ title: 'Erlenmatt Ost', area: '6002500 m²', completion: 'Q2 2027', note: 'Modernes Stadtentwicklungsareal' },
],
'Zug': [
{ title: 'Zug Innovation Campus', area: '2001000 m²', completion: 'Q1 2026', note: 'Steuerattraktiv, ÖV-optimal' },
],
'Bern': [
{ title: 'Bern West Business Park', area: '4003000 m²', completion: 'Q2 2026', note: 'Modernes Gewerbeareal Ausserholligen' },
],
'Winterthur': [
{ title: 'Sulzerareal Phase 4', area: '8004000 m²', completion: 'Q3 2027', note: 'Industrie-Loft-Flächen im Stadtentwicklungsgebiet' },
],
}
import { KpiTile } from './KpiTile'
import { NEW_PROJECTS } from './locationIntelligenceConstants'
// ── Main component ────────────────────────────────────────────────────────────