Files
property-match/src/components/supply/propertyHelpers.ts
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

64 lines
1.8 KiB
TypeScript

import type { AssetType, AvailabilityStatus, ResultType } from '../../domain/enums'
import { RESULT_TYPE_META } from '../../lib/ds'
import { dataQualityColor } from '../../lib/utils'
export function getAssetTypeLabel(type: AssetType): string {
const labels: Record<string, string> = {
OFFICE: 'Büro',
LOGISTICS: 'Logistik',
RETAIL: 'Retail',
GASTRO: 'Gastro',
PRODUCTION: 'Produktion',
MIXED: 'Gemischt',
LIGHT_INDUSTRIAL: 'Gewerbe',
UNKNOWN: 'Unbekannt',
}
return labels[type] ?? type
}
export function getAssetTypeColor(type: AssetType): string {
const colors: Record<string, string> = {
OFFICE: '#152642',
LOGISTICS: '#d97706',
RETAIL: '#7c3aed',
GASTRO: '#0d9488',
PRODUCTION: '#92400e',
MIXED: '#6b7280',
LIGHT_INDUSTRIAL: '#b45309',
UNKNOWN: '#9ca3af',
}
return colors[type] ?? '#6b7280'
}
export function getAvailabilityLabel(status: AvailabilityStatus): string {
const labels: Record<string, string> = {
AVAILABLE_NOW: 'Verfügbar',
AVAILABLE_SOON: 'Bald verfügbar',
FUTURE_SIGNAL: 'Zukunftssignal',
OCCUPIED: 'Belegt',
UNKNOWN: 'Unbekannt',
}
return labels[status] ?? status
}
export function getAvailabilityChipColor(status: AvailabilityStatus): 'success' | 'warning' | 'secondary' | 'error' | 'default' {
const colors: Record<string, 'success' | 'warning' | 'secondary' | 'error' | 'default'> = {
AVAILABLE_NOW: 'success',
AVAILABLE_SOON: 'warning',
FUTURE_SIGNAL: 'secondary',
OCCUPIED: 'error',
UNKNOWN: 'default',
}
return colors[status] ?? 'default'
}
export function getResultTypeLabel(type: ResultType): string {
return RESULT_TYPE_META[type]?.label ?? type
}
export function getResultTypeColor(type: ResultType): string {
return RESULT_TYPE_META[type]?.color ?? '#6b7280'
}
export const qualityColor = dataQualityColor