refactor: extract constants + mapper from NewListing.tsx (526 → 442 lines)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Sutter
2026-05-24 01:05:57 +02:00
parent 0bacd188d6
commit f0988b7250
3 changed files with 156 additions and 109 deletions
+53
View File
@@ -0,0 +1,53 @@
export const ASSET_TYPE_LABELS: Record<string, string> = {
OFFICE: 'Büro',
RETAIL: 'Einzelhandel',
LIGHT_INDUSTRIAL: 'Leichtindustrie',
LOGISTICS: 'Logistik',
PRODUCTION: 'Produktion',
MIXED: 'Gemischt',
}
export const SOFT_FACTORS = [
{ key: 'prestige', label: 'Prestige / Adressqualität' },
{ key: 'accessibility', label: 'ÖV-Anbindung' },
{ key: 'visibility', label: 'Sichtbarkeit' },
{ key: 'footfall', label: 'Passantenfrequenz' },
{ key: 'talentAccess', label: 'Fachkräfte / Talent' },
{ key: 'esg', label: 'ESG / Nachhaltigkeit' },
{ key: 'flexibility', label: 'Flexibilität Grundriss' },
{ key: 'expansionPotential', label: 'Expansionspotenzial' },
{ key: 'taxEnvironment', label: 'Steuerumgebung' },
]
export const LEVEL_OPTIONS = [
{ value: '', label: 'Keine Angabe' },
{ value: 'LOW', label: 'Tief' },
{ value: 'MEDIUM', label: 'Mittel' },
{ value: 'HIGH', label: 'Hoch' },
]
export const LEVEL_TO_SCORE: Record<string, number | undefined> = {
LOW: 0.30, MEDIUM: 0.55, HIGH: 0.85, '': undefined,
}
export const FIT_OUT_OPTIONS = [
{ value: '', label: 'Keine Angabe' },
{ value: 'SHELL', label: 'Rohbau' },
{ value: 'BASIC', label: 'Basis-Ausbau' },
{ value: 'FULL', label: 'Vollausbau' },
{ value: 'PREMIUM', label: 'Premiumausbau' },
]
export interface LocationState {
prefill?: {
assetType?: string
street?: string
houseNumber?: string
postalCode?: string
city?: string
areaSqm?: number
rentPricePerSqm?: number
unitLabel?: string
propertyId?: string
}
}