diff --git a/src/components/supply/PropertyDetailView.tsx b/src/components/supply/PropertyDetailView.tsx index 6762c7a..1a57b70 100644 --- a/src/components/supply/PropertyDetailView.tsx +++ b/src/components/supply/PropertyDetailView.tsx @@ -28,11 +28,13 @@ import { PropertyMarketSignalsTab } from './PropertyMarketSignalsTab' interface PropertyDetailViewProps { propertyId: string onClose?: () => void + hideTabs?: Array<'Matchability' | 'Marktsignale'> } -const TABS = ['Übersicht', 'Matchability', 'Marktsignale'] as const +const ALL_TABS = ['Übersicht', 'Matchability', 'Marktsignale'] as const -export function PropertyDetailView({ propertyId, onClose }: PropertyDetailViewProps) { +export function PropertyDetailView({ propertyId, onClose, hideTabs = [] }: PropertyDetailViewProps) { + const TABS = ALL_TABS.filter(t => !hideTabs.includes(t as 'Matchability' | 'Marktsignale')) const [tab, setTab] = useState(0) const [editing, setEditing] = useState(false) const [draft, setDraft] = useState({}) @@ -175,8 +177,8 @@ export function PropertyDetailView({ propertyId, onClose }: PropertyDetailViewPr {/* Tab content */} - - {tab === 0 && ( + + {TABS[tab] === 'Übersicht' && ( )} - {tab === 1 && } - {tab === 2 && } + {TABS[tab] === 'Matchability' && } + {TABS[tab] === 'Marktsignale' && } ) diff --git a/src/pages/supply/MyListings.tsx b/src/pages/supply/MyListings.tsx index acd413e..542b2ca 100644 --- a/src/pages/supply/MyListings.tsx +++ b/src/pages/supply/MyListings.tsx @@ -423,7 +423,7 @@ export default function MyListings() { slotProps={{ paper: { sx: { width: { xs: '100%', sm: 560 } } } }} > {detailId && ( - setDetailId(null)} /> + setDetailId(null)} hideTabs={['Matchability']} /> )}