diff --git a/src/components/anfragencenter/RelatedPropertyCardPanel.tsx b/src/components/anfragencenter/RelatedPropertyCardPanel.tsx index 3c3a14b..acfd303 100644 --- a/src/components/anfragencenter/RelatedPropertyCardPanel.tsx +++ b/src/components/anfragencenter/RelatedPropertyCardPanel.tsx @@ -1,6 +1,5 @@ -import { useState } from 'react' -import { Box, Button, CircularProgress, Divider, IconButton, Typography } from '@mui/material' -import { ArrowRight, Building2, Calendar, ChevronLeft, ChevronRight, MapPin, Ruler } from 'lucide-react' +import { Box, Button, CircularProgress, Divider, Typography } from '@mui/material' +import { ArrowRight, Building2, Calendar, MapPin, Ruler } from 'lucide-react' import { useNavigate } from 'react-router' import { usePropertyById } from '../../hooks/useProperties' import { useAdditionalMatchesForInquiry } from '../../hooks/useMatches' @@ -15,7 +14,6 @@ interface RelatedPropertyCardPanelProps { export function RelatedPropertyCardPanel({ propertyId, inquiryId, compact }: RelatedPropertyCardPanelProps) { const { data: property, isLoading } = usePropertyById(propertyId) const navigate = useNavigate() - const [sliderIndex, setSliderIndex] = useState(0) const { data: additionalMatches = [], isLoading: loadingMatches, @@ -30,40 +28,14 @@ export function RelatedPropertyCardPanel({ propertyId, inquiryId, compact }: Rel } if (compact) { - const visibleMatches = additionalMatches.slice(sliderIndex, sliderIndex + 2) - const canGoBack = sliderIndex > 0 - const canGoForward = sliderIndex + 2 < additionalMatches.length - return ( - - - - Weitere passende Objekte - - {additionalMatches.length > 2 && ( - - setSliderIndex(i => i - 1)} - sx={{ p: 0.25, color: canGoBack ? '#152642' : '#cbd5e1' }} - > - - - setSliderIndex(i => i + 1)} - sx={{ p: 0.25, color: canGoForward ? '#152642' : '#cbd5e1' }} - > - - - - )} - + + + Weitere passende Objekte + {loadingMatches ? ( @@ -74,8 +46,17 @@ export function RelatedPropertyCardPanel({ propertyId, inquiryId, compact }: Rel Keine weiteren Matches ) : ( - - {visibleMatches.map(m => ( + + {additionalMatches.map(m => ( ))} @@ -198,8 +179,8 @@ function MatchSliderCard({ match }: { match: AdditionalPropertyMatch }) { navigate('/supply/properties')} sx={{ - flex: '1 1 0', - minWidth: 0, + flexShrink: 0, + width: 240, border: '1px solid #e8e7e4', borderRadius: 2, overflow: 'hidden', @@ -213,7 +194,7 @@ function MatchSliderCard({ match }: { match: AdditionalPropertyMatch }) { }} > {/* Image with consistent aspect ratio */} - + {match.imageUrl ? (