feat: supply card metrics — replace Prestige with Anfragen count

Senior property manager perspective: the three key metrics are
Fläche (size), Frei ab (availability date), and Anfragen (active
inquiry count). Anfragen box highlights amber when > 0. Rename
Datenkonfidenz → Datenvollständigkeit (clearer for the manager).
Remove ÖV chip, keep fit-out and contract chips as property specs.
Wire inquiryCount from useActiveInquiries in Properties page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Sutter
2026-06-09 22:36:45 +02:00
parent 884bb468b8
commit e6c20958a5
2 changed files with 68 additions and 30 deletions
+11 -1
View File
@@ -5,6 +5,7 @@ import { ChevronDown, ChevronUp } from 'lucide-react'
import { PageHeader } from '../../components/layout'
import { ViewToggle } from '../../components/shared'
import { useProperties } from '../../hooks/useProperties'
import { useActiveInquiries } from '../../hooks/useInquiries'
import { PropertyFilterBar, PropertyTable, PropertyDetailView, PropertyIntelligenceCard } from '../../components/supply'
import type { PropertyTableFilters } from '../../components/supply'
import type { Property } from '../../domain/property'
@@ -61,6 +62,15 @@ export default function Properties() {
)
const { data: properties = [], isLoading, isError } = useProperties()
const { data: inquiries = [] } = useActiveInquiries()
const inquiryCountByProperty = useMemo(() => {
const map = new Map<string, number>()
for (const inq of inquiries) {
if (inq.propertyId) map.set(inq.propertyId, (map.get(inq.propertyId) ?? 0) + 1)
}
return map
}, [inquiries])
const filtered = useMemo(() => applyFilters(properties, filters), [properties, filters])
@@ -193,7 +203,7 @@ export default function Properties() {
{view === 'grid' ? (
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(320px, 1fr))', gap: 2, p: 2.5 }}>
{filtered.map(p => (
<PropertyIntelligenceCard key={p.id} property={p} onSelect={setSelectedId} />
<PropertyIntelligenceCard key={p.id} property={p} onSelect={setSelectedId} inquiryCount={inquiryCountByProperty.get(p.id) ?? 0} />
))}
</Box>
) : (