// ----------------------------------------------------------------------------- // 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"; import { Ico } from "./Icons"; export default function ListingCard({ l }: { l: Listing }) { const img = l.images && l.images.length > 0 ? l.images[0] : null; const meta: { ico: string; txt: string }[] = []; if (l.bedrooms != null) meta.push({ ico: "bed", txt: `${l.bedrooms} ch.` }); if (l.bathrooms != null) meta.push({ ico: "bath", txt: `${l.bathrooms} sdb` }); const area = fmtArea(l.area_sqft); if (area) meta.push({ ico: "area", txt: 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.txt} ))}
)}
{sourceName(l.source)} {l.mls && MLS {l.mls}}
); }