feat: clickable NeedMatchCard in Matchability tab navigates to Anfragencenter
Clicking a need card in the Matchability tab pre-selects the property and navigates to Anfragencenter → Latente Anfragen tab. Angebot creation lives here (demand-side), not in Marktsignale. NeedMatchCard gains onClick prop with navy hover + shadow treatment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useNavigate } from 'react-router'
|
||||
import {
|
||||
Alert,
|
||||
Box,
|
||||
@@ -15,6 +16,7 @@ import {
|
||||
} from '@mui/material'
|
||||
import { useQueryClient } from '@tanstack/react-query'
|
||||
import { Edit2, Save, X } from 'lucide-react'
|
||||
import { useOfferWizardStore } from '../../stores/offerWizardStore'
|
||||
import { PropertyMap } from '../shared'
|
||||
import { NeedMatchCard } from './NeedMatchCard'
|
||||
import { PropertyMarketSignalsTab } from './PropertyMarketSignalsTab'
|
||||
@@ -238,6 +240,8 @@ function OverviewPanel({ p, editing, draft, onDraftChange }: OverviewPanelProps)
|
||||
function MatchabilityTabPanel({ propertyId }: { propertyId: string }) {
|
||||
const [matches, setMatches] = useState<PropertyNeedMatch[]>([])
|
||||
const [loading, setLoading] = useState(true)
|
||||
const navigate = useNavigate()
|
||||
const setSelectedProperties = useOfferWizardStore(s => s.setSelectedProperties)
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false
|
||||
@@ -248,6 +252,11 @@ function MatchabilityTabPanel({ propertyId }: { propertyId: string }) {
|
||||
return () => { cancelled = true }
|
||||
}, [propertyId])
|
||||
|
||||
function handleNeedCardClick() {
|
||||
setSelectedProperties([propertyId])
|
||||
navigate('/supply/anfragen', { state: { tab: 1 } })
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<Box sx={{ p: 3, display: 'flex', justifyContent: 'center' }}>
|
||||
@@ -263,7 +272,7 @@ function MatchabilityTabPanel({ propertyId }: { propertyId: string }) {
|
||||
Matchability
|
||||
</Typography>
|
||||
<Typography variant="caption" color="text.secondary">
|
||||
Bedarfsprofile mit ≥ 80% Match-Score für dieses Objekt
|
||||
Bedarfsprofile mit ≥ 80% Match-Score — Karte klicken um Angebot zu erstellen
|
||||
</Typography>
|
||||
</Box>
|
||||
{matches.length === 0 ? (
|
||||
@@ -271,7 +280,7 @@ function MatchabilityTabPanel({ propertyId }: { propertyId: string }) {
|
||||
Keine Bedarfsprofile mit ≥ 80% Match-Score für dieses Objekt gefunden.
|
||||
</Alert>
|
||||
) : (
|
||||
matches.map(m => <NeedMatchCard key={m.matchId} match={m} />)
|
||||
matches.map(m => <NeedMatchCard key={m.matchId} match={m} onClick={handleNeedCardClick} />)
|
||||
)}
|
||||
</Box>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user