// ----------------------------------------------------------------------------- // Immo-Ka — Agrégateur de propriétés à vendre (province de Québec) // Auteur : Simon-Pierre Boucher — contact@spboucher.ai // components/ListingCard.tsx : carte de propriété (grille de résultats) // ----------------------------------------------------------------------------- import { Link } from "react-router-dom"; import { Listing, fmtArea, fmtPrice, sourceName } from "../api"; export default function ListingCard({ l }: { l: Listing }) { const img = l.images && l.images.length > 0 ? l.images[0] : null; const meta: string[] = []; if (l.bedrooms != null) meta.push(`${l.bedrooms} ch.`); if (l.bathrooms != null) meta.push(`${l.bathrooms} sdb`); const area = fmtArea(l.area_sqft); if (area) meta.push(area); return (
{img ? ( {l.title ) : (
🏠
)} {l.property_type && {l.property_type}} {l.images.length > 1 && ( 📷 {l.images.length} )}
{fmtPrice(l.price, l.price_label)}
{l.address || l.title}
{l.sector && {l.sector}} {l.sector && l.city && } {l.city && {l.city}}
{meta.length > 0 && (
{meta.map((m) => ( {m} ))}
)}
{sourceName(l.source)} {l.mls && MLS {l.mls}}
); }