// ----------------------------------------------------------------------------- // Home-Ka — US real-estate aggregator (Groupe KA) // Author: Simon-Pierre Boucher — contact@spboucher.ai // components/ListingCard.tsx : home card (results grid) // ----------------------------------------------------------------------------- import { Link } from "react-router-dom"; import { Listing, STATUS_LABELS, fmtArea, fmtBaths, fmtCityLine, fmtPrice, sourceName } from "../api"; import { Ico } from "./Icons"; import PropertyImg from "./PropertyImg"; export default function ListingCard({ l }: { l: Listing }) { // lightweight thumbnail if the connector provides one (mobile/cellular), // otherwise the full-size cover photo const img = (typeof l.details?.cover_thumb === "string" && l.details.cover_thumb) || (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} bd` }); if (l.bathrooms != null) meta.push({ ico: "bath", txt: `${fmtBaths(l.bathrooms)} ba` }); const area = fmtArea(l.living_area_sqft); if (area) meta.push({ ico: "area", txt: area }); const statusBadge = l.status && l.status !== "active" ? STATUS_LABELS[l.status] ?? l.status : null; return (