refactor: extract sub-components from PropertyMarketSignalsTab + NegotiationInsightsPanel
- PropertyMarketSignalsTab (416→100 lines): SignalCard, BerichtDialog → own files - NegotiationInsightsPanel (345→260 lines): pure logic → negotiationInsightsUtils.ts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,92 +4,7 @@ import { useProperties } from '../../hooks/useProperties'
|
||||
import { useNeeds } from '../../hooks/useNeeds'
|
||||
import { getCityIntelligence, getMarketRent } from '../../lib/locationIntelligence'
|
||||
import type { Property } from '../../domain/property'
|
||||
|
||||
// ── Selling argument generator ────────────────────────────────────────────────
|
||||
|
||||
interface Argument {
|
||||
title: string
|
||||
detail: string
|
||||
strength: 'strong' | 'medium'
|
||||
}
|
||||
|
||||
function generateSellingArguments(p: Property): Argument[] {
|
||||
const args: Argument[] = []
|
||||
const sf = p.softFactors
|
||||
const intel = getCityIntelligence(p.location.city)
|
||||
|
||||
if (sf) {
|
||||
const footfall = sf.footfallScore ?? (sf.passerbyFrequency ? { LOW: 0.25, MEDIUM: 0.5, HIGH: 0.78, VERY_HIGH: 0.95 }[sf.passerbyFrequency] ?? 0 : 0)
|
||||
if (footfall >= 0.72)
|
||||
args.push({ title: 'Hervorragende Frequenzlage', detail: 'Überdurchschnittliche Passantenfrequenz — sichert Sichtbarkeit und Kundenzugang.', strength: 'strong' })
|
||||
|
||||
const taxScore = sf.taxEnvironmentScore ?? (intel ? Math.max(0, 1 - intel.taxIndexCanton / 150) : undefined)
|
||||
if (taxScore !== undefined && taxScore >= 0.65)
|
||||
args.push({ title: 'Steuerattraktiver Standort', detail: `${p.location.city} bietet eine günstige Steuerlast${intel ? ` (Index ${intel.taxIndexCanton}, CH = 100)` : ''} — relevant für Unternehmensansiedlungen.`, strength: 'strong' })
|
||||
|
||||
const ov = sf.commuterAccessScore
|
||||
if (ov !== undefined && ov >= 0.72)
|
||||
args.push({ title: 'Sehr gute ÖV-Anbindung', detail: sf.publicTransportMinutes ? `Ca. ${sf.publicTransportMinutes} Min. zum nächsten Bahnhof.` : 'Ausgezeichnete öffentliche Erreichbarkeit.', strength: 'strong' })
|
||||
|
||||
const prestige = sf.prestigeScore ?? (typeof sf.prestige === 'number' ? sf.prestige : undefined)
|
||||
if (prestige !== undefined && prestige >= 0.7)
|
||||
args.push({ title: 'Repräsentativer Standort', detail: 'Hoher Prestige-Wert — ideal für Unternehmen mit Repräsentationsanspruch und Aussenauftritt.', strength: 'strong' })
|
||||
|
||||
const talent = sf.talentAccessScore ?? (typeof sf.talentAccess === 'number' ? sf.talentAccess : undefined)
|
||||
if (talent !== undefined && talent >= 0.65)
|
||||
args.push({ title: 'Grosser Talentpool', detail: 'Zugang zu gut ausgebildeten Fachkräften im Einzugsgebiet — entscheidend für wachsende Unternehmen.', strength: 'medium' })
|
||||
|
||||
if (sf.flexibilityScore !== undefined && sf.flexibilityScore >= 0.65)
|
||||
args.push({ title: 'Flexible Flächengestaltung', detail: 'Grundriss und Ausbaustandard ermöglichen individuelle Anpassungen.', strength: 'medium' })
|
||||
|
||||
if (sf.esgScore !== undefined && sf.esgScore >= 0.7)
|
||||
args.push({ title: 'Nachhaltigkeitszertifizierung', detail: 'Guter ESG-Score — relevant für Unternehmen mit Nachhaltigkeitszielen und ESG-Reporting.', strength: 'medium' })
|
||||
}
|
||||
|
||||
if (p.hardFacts?.isBarrierFree)
|
||||
args.push({ title: 'Barrierefrei', detail: 'Vollständig rollstuhlgängig — gesetzlich zunehmend gefordert.', strength: 'medium' })
|
||||
|
||||
if (p.hardFacts?.parking && p.hardFacts.parking > 0)
|
||||
args.push({ title: `${p.hardFacts.parking} Parkplätze inkl.`, detail: 'Eigene Parkierungsmöglichkeiten — in Städten ein knappes Gut.', strength: 'medium' })
|
||||
|
||||
if (p.hardFacts?.hasServerRoom)
|
||||
args.push({ title: 'Serverraum vorhanden', detail: 'Sofortig nutzbare IT-Infrastruktur — spart Einrichtungskosten.', strength: 'medium' })
|
||||
|
||||
if (intel?.demandStrength === 'VERY_HIGH' || intel?.demandStrength === 'HIGH')
|
||||
args.push({ title: 'Stark nachgefragter Markt', detail: `${p.location.city} verzeichnet ${intel.demandStrength === 'VERY_HIGH' ? 'sehr hohe' : 'hohe'} Nachfrage — kurze Leerstandszeiten zu erwarten.`, strength: 'strong' })
|
||||
|
||||
return args
|
||||
}
|
||||
|
||||
// ── Proactive weakness acknowledgement ───────────────────────────────────────
|
||||
|
||||
interface Weakness {
|
||||
issue: string
|
||||
mitigation: string
|
||||
}
|
||||
|
||||
function generateWeaknesses(p: Property): Weakness[] {
|
||||
const ws: Weakness[] = []
|
||||
const sf = p.softFactors
|
||||
const intel = getCityIntelligence(p.location.city)
|
||||
|
||||
if (intel && intel.vacancyRatePct >= 5)
|
||||
ws.push({ issue: 'Hohe Leerstandsquote in der Region', mitigation: 'Mietfreie Zeit oder Ausbaukostenbeteiligung als Anreiz anbieten.' })
|
||||
|
||||
if (intel && intel.taxIndexCanton >= 115)
|
||||
ws.push({ issue: 'Überdurchschnittliche Steuerlast', mitigation: 'Andere Standortvorteile (Prestige, ÖV) gezielt hervorheben.' })
|
||||
|
||||
if (sf?.commuterAccessScore !== undefined && sf.commuterAccessScore < 0.45)
|
||||
ws.push({ issue: 'Eingeschränkte ÖV-Anbindung', mitigation: 'Parkplatz-Angebot und Veloinfrastruktur als Alternative betonen.' })
|
||||
|
||||
if (p.hardFacts?.parking === 0 || (p.hardFacts?.parking === undefined && !sf?.parkingSpots))
|
||||
ws.push({ issue: 'Keine eigenen Parkplätze', mitigation: 'Öffentliche Parkhäuser in der Nähe aufzeigen. Ggf. Parkabonnement als Mietbonus anbieten.' })
|
||||
|
||||
if (p.dataQuality.score < 0.65)
|
||||
ws.push({ issue: 'Unvollständige Objektdaten', mitigation: 'Fehlende Angaben vor dem Gespräch vervollständigen, um Vertrauen zu stärken.' })
|
||||
|
||||
return ws
|
||||
}
|
||||
import { generateSellingArguments, generateWeaknesses } from './negotiationInsightsUtils'
|
||||
|
||||
// ── Main component ────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user