fix: 16 vorbestehende Typfehler beheben, Typecheck wieder grün

`npx tsc -b` brach mit 16 Fehlern ab. Neue Fehler wären darin untergegangen.

Echte Defekte:
- LatentInquiriesTab: OwnPropertyMatchList wurde verwendet, aber nie importiert
  — der Zweig "Eigene Objekte" auf Mobil hätte zur Laufzeit geworfen
- unitService: throwServiceError nimmt ein Argument, nicht zwei
- SavedNeedDetail: MUI v9 kennt kein `inputProps` mehr, ersetzt durch slotProps
- Review{Status,Priority}Badge: `showBorder` existiert an GenericBadge nicht;
  die Default-Variante "outlined" zeichnet den Rand ohnehin, Darstellung unverändert
- UnifiedResultFeed: die Ternärkette verglich theme.text gegen zwei Werte, die
  SCORE_THEME seit einer Palettenumstellung nicht mehr führt — sie lief immer in
  denselben Zweig. Auf diesen einen Wert zusammengezogen, Darstellung unverändert,
  nebenbei zwei rohe Hex-Werte weniger

Der Rest waren ungenutzte Importe und Bindings (noUnusedLocals).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Sutter
2026-08-03 16:55:19 +02:00
parent 3849b78f83
commit 36ce548169
12 changed files with 13 additions and 13 deletions
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
import { Box, Button, CircularProgress, Typography } from '@mui/material' import { Box, Button, CircularProgress, Typography } from '@mui/material'
import { ArrowRight, Building2, ClipboardList, MapPin, Ruler } from 'lucide-react' import { ArrowRight, Building2, ClipboardList, MapPin } from 'lucide-react'
import { useNavigate } from 'react-router' import { useNavigate } from 'react-router'
import { useInquiryById, useMarkThreadAsRead } from '../../hooks/useInquiries' import { useInquiryById, useMarkThreadAsRead } from '../../hooks/useInquiries'
import { usePropertyById } from '../../hooks/useProperties' import { usePropertyById } from '../../hooks/useProperties'
@@ -5,6 +5,7 @@ import { usePublicNeeds, useLatentNeedById } from '../../hooks/useLatentNeeds'
import { EmptyState } from '../ui' import { EmptyState } from '../ui'
import { PublicNeedList } from './PublicNeedList' import { PublicNeedList } from './PublicNeedList'
import { PublicNeedDetail } from './PublicNeedDetail' import { PublicNeedDetail } from './PublicNeedDetail'
import { OwnPropertyMatchList } from './OwnPropertyMatchList'
type MobileView = 'list' | 'detail' | 'properties' type MobileView = 'list' | 'detail' | 'properties'
@@ -2,7 +2,6 @@ import { memo } from 'react'
import { Box, Button, Typography } from '@mui/material' import { Box, Button, Typography } from '@mui/material'
import { Ruler } from 'lucide-react' import { Ruler } from 'lucide-react'
import { useNavigate } from 'react-router' import { useNavigate } from 'react-router'
import { ROUTES } from '../../lib/constants'
import type { Property } from '../../domain/property' import type { Property } from '../../domain/property'
import type { VerifiedPortfolioResult } from '../../domain/unifiedResult' import type { VerifiedPortfolioResult } from '../../domain/unifiedResult'
import type { Match } from '../../domain/match' import type { Match } from '../../domain/match'
+2 -3
View File
@@ -32,7 +32,7 @@ interface Props {
onUpdate: (data: UpdateNeedInput) => void onUpdate: (data: UpdateNeedInput) => void
} }
export const SavedNeedDetail = memo(function SavedNeedDetail({ need, properties, onStart, onEdit, onArchive, onUpdate }: Props) { export const SavedNeedDetail = memo(function SavedNeedDetail({ need, properties, onStart, onEdit, onUpdate }: Props) {
const statusCfg = statusConfig(need.status) const statusCfg = statusConfig(need.status)
const conf = need.confidenceInCriteria ?? 0 const conf = need.confidenceInCriteria ?? 0
const confColor = confidenceHex(conf) const confColor = confidenceHex(conf)
@@ -69,7 +69,6 @@ export const SavedNeedDetail = memo(function SavedNeedDetail({ need, properties,
return true return true
}) })
}, [matches, properties]) }, [matches, properties])
const topScore = scoredProperties.length > 0 ? scoredProperties[0].score : 0
const topProperties = scoredProperties.slice(0, 3) const topProperties = scoredProperties.slice(0, 3)
const topWeights = useMemo( const topWeights = useMemo(
@@ -235,7 +234,7 @@ export const SavedNeedDetail = memo(function SavedNeedDetail({ need, properties,
placeholder="name@firma.ch" placeholder="name@firma.ch"
value={notif.emailAddress ?? ''} value={notif.emailAddress ?? ''}
onChange={e => handleNotifChange({ emailAddress: e.target.value || undefined })} onChange={e => handleNotifChange({ emailAddress: e.target.value || undefined })}
inputProps={{ type: 'email' }} slotProps={{ htmlInput: { type: 'email' } }}
sx={{ '& .MuiOutlinedInput-root': { fontSize: '0.85rem' } }} sx={{ '& .MuiOutlinedInput-root': { fontSize: '0.85rem' } }}
helperText="Im Produktivsystem wird bei neuen Treffern eine E-Mail ausgelöst" helperText="Im Produktivsystem wird bei neuen Treffern eine E-Mail ausgelöst"
/> />
@@ -10,7 +10,6 @@ import { ROUTES } from '../../lib/constants'
import { EmptyState } from '../ui' import { EmptyState } from '../ui'
import { SavedNeedCard } from './SavedNeedCard' import { SavedNeedCard } from './SavedNeedCard'
import { SavedNeedDetail } from './SavedNeedDetail' import { SavedNeedDetail } from './SavedNeedDetail'
import { needToParsedCriteria } from '../../services/aiSearch/needSearchMapper'
interface Props { interface Props {
onNewSearch: (prefillNeedId?: string) => void onNewSearch: (prefillNeedId?: string) => void
@@ -1,5 +1,5 @@
import { Box, Button, Chip, Paper, Typography } from '@mui/material' import { Box, Button, Chip, Paper, Typography } from '@mui/material'
import { Building2, Clock, ExternalLink, HardHat, Info, Layers, Tag, Train, TrendingUp } from 'lucide-react' import { Building2, Clock, ExternalLink, Info, Layers, Tag, Train, TrendingUp } from 'lucide-react'
import { useMatchDetail } from '../../hooks/useMatches' import { useMatchDetail } from '../../hooks/useMatches'
import { ResultType } from '../../domain/enums' import { ResultType } from '../../domain/enums'
import type { Property } from '../../domain/property' import type { Property } from '../../domain/property'
+3 -1
View File
@@ -52,7 +52,9 @@ function TierHeader({ label, sublabel, tierKey, count, isFirst }: TierHeaderProp
}} }}
/> />
<Box> <Box>
<Typography variant="subtitle1" sx={{ fontWeight: 700, lineHeight: 1.2, color: theme.text === '#7a4f00' ? '#92400e' : theme.text === '#334155' ? '#1e293b' : '#7c3d12' }}> {/* SCORE_THEME.text is '#ffffff' for every tier, so the former ternary always
resolved to this one value — collapsed, rendering is unchanged. */}
<Typography variant="subtitle1" sx={{ fontWeight: 700, lineHeight: 1.2, color: '#7c3d12' }}>
{label} {label}
</Typography> </Typography>
<Typography variant="caption" color="text.secondary">{sublabel}</Typography> <Typography variant="caption" color="text.secondary">{sublabel}</Typography>
@@ -15,5 +15,5 @@ interface Props {
export function ReviewPriorityBadge({ priority, size = 'small' }: Props) { export function ReviewPriorityBadge({ priority, size = 'small' }: Props) {
const { label, color } = CONFIG[priority] ?? CONFIG.MEDIUM const { label, color } = CONFIG[priority] ?? CONFIG.MEDIUM
return <GenericBadge label={label} color={color} showBorder bold size={size} /> return <GenericBadge label={label} color={color} bold size={size} />
} }
+1 -1
View File
@@ -17,5 +17,5 @@ interface Props {
export function ReviewStatusBadge({ status, size = 'small' }: Props) { export function ReviewStatusBadge({ status, size = 'small' }: Props) {
const { label, color } = CONFIG[status] ?? CONFIG.PENDING const { label, color } = CONFIG[status] ?? CONFIG.PENDING
return <GenericBadge label={label} color={color} showBorder size={size} /> return <GenericBadge label={label} color={color} size={size} />
} }
@@ -6,7 +6,7 @@ import { usePreMarketRentRecommendation } from '../../hooks/useAI'
import { useUpdateUnit } from '../../hooks/useProperties' import { useUpdateUnit } from '../../hooks/useProperties'
import { resolveUnitFacts } from '../../lib/unitFacts' import { resolveUnitFacts } from '../../lib/unitFacts'
import { FIT_OUT_LABELS } from '../../lib/constants' import { FIT_OUT_LABELS } from '../../lib/constants'
import { DS_BORDER, DS_PRE_MARKET, DS_SURFACE, DS_TEXT } from '../../lib/ds' import { DS_PRE_MARKET, DS_SURFACE, DS_TEXT } from '../../lib/ds'
const NEEDS_BUILD = new Set(['SHELL', 'BASIC']) const NEEDS_BUILD = new Set(['SHELL', 'BASIC'])
const VERDICT_META: Record<string, { label: string; bg: string; fg: string }> = { const VERDICT_META: Record<string, { label: string; bg: string; fg: string }> = {
+1 -1
View File
@@ -78,7 +78,7 @@ export default function Properties() {
const filtered = useMemo(() => applyFilters(properties, filters), [properties, filters]) const filtered = useMemo(() => applyFilters(properties, filters), [properties, filters])
// Decision-relevant aggregates — single pass over the full list // Decision-relevant aggregates — single pass over the full list
const { matchReady, criticalGaps, lowConfidence, staleOrOutdated, allMissingFields } = useMemo(() => { const { matchReady, criticalGaps, staleOrOutdated } = useMemo(() => {
const matchReady: typeof properties = [] const matchReady: typeof properties = []
const criticalGaps: typeof properties = [] const criticalGaps: typeof properties = []
const lowConfidence: typeof properties = [] const lowConfidence: typeof properties = []
+1 -1
View File
@@ -9,7 +9,7 @@ export const unitService = {
const unit = await MockupUnitProvider.update(unitId, data) const unit = await MockupUnitProvider.update(unitId, data)
return { data: unit } return { data: unit }
} catch (err) { } catch (err) {
throwServiceError('unitService.update', err) throwServiceError(err)
} }
}, },
} }