import { ExternalLink, Bed, Maximize2, PoundSterling, Clock, Building } from 'lucide-react'; import { Button } from './ui/button'; import type { PropertyProperties } from '@/types'; interface PropertyCardProps { property: PropertyProperties; variant?: 'compact' | 'full'; isHighlighted?: boolean; avgPricePerSqm?: number; onClick?: () => void; } export function PropertyCard({ property, variant = 'compact', isHighlighted = false, avgPricePerSqm, onClick, }: PropertyCardProps) { const lastSeenDate = property.last_seen.split('T')[0]; const lastSeenDays = Math.round((Date.now() - new Date(lastSeenDate).getTime()) / (1000 * 60 * 60 * 24)); // Determine if this is a good deal const isGoodDeal = avgPricePerSqm && property.qmprice > 0 && property.qmprice < avgPricePerSqm * 0.9; const isExpensive = avgPricePerSqm && property.qmprice > avgPricePerSqm * 1.1; const priceIndicator = isGoodDeal ? { color: 'text-green-600 bg-green-50', label: 'Good deal' } : isExpensive ? { color: 'text-red-600 bg-red-50', label: 'Above avg' } : null; const handleClick = () => { window.open(property.url, '_blank', 'noopener,noreferrer'); onClick?.(); }; if (variant === 'compact') { return (