import { Box, Button, CircularProgress, Typography } from '@mui/material'
import { ArrowRight, Building2, Calendar, MapPin, Ruler } from 'lucide-react'
import { useNavigate } from 'react-router'
import { usePropertyById } from '../../hooks/useProperties'
interface RelatedPropertyCardPanelProps {
propertyId: string
}
export function RelatedPropertyCardPanel({ propertyId }: RelatedPropertyCardPanelProps) {
const { data: property, isLoading } = usePropertyById(propertyId)
const navigate = useNavigate()
if (isLoading) {
return (
)
}
if (!property) {
return (
Objekt nicht gefunden
)
}
const image = property.images?.[0]
return (
Bezogenes Objekt
{!image && }
{property.title}
{property.location.city}
{property.location.district ? `, ${property.location.district}` : ''}
{property.areaSqm.toLocaleString('de-CH')} m² · CHF {property.rentPricePerSqm}/m²
Verfügbar ab {new Date(property.availabilityDate).toLocaleDateString('de-CH')}
{property.description && (
{property.description}
)}
}
onClick={() => navigate('/supply/properties')}
sx={{ textTransform: 'none', mt: 'auto' }}
>
Objekt ansehen
)
}