import { Link } from 'react-router-dom'; import HeartButton from './HeartButton'; export interface FavoriteCardEntry { id: string; slug: string; title: string; price: string; type: 'venda' | 'aluguel'; photo: string | null; city: string | null; bedrooms: number; area_m2: number; } function formatPrice(price: string, type: 'venda' | 'aluguel') { const num = parseFloat(price); if (isNaN(num)) return price; const formatted = num.toLocaleString('pt-BR', { style: 'currency', currency: 'BRL', maximumFractionDigits: 0 }); return type === 'aluguel' ? `${formatted}/mês` : formatted; } interface FavoritesCardsGridProps { entries: FavoriteCardEntry[]; } export default function FavoritesCardsGrid({ entries }: FavoritesCardsGridProps) { if (entries.length === 0) { return (
Nenhum favorito ainda
Explorar imóveis →{entry.title}
{entry.city && ({entry.city}
)} {entry.price && ({formatPrice(entry.price, entry.type)}
)}