= {
"Single Family": "home", "Single-Family": "home", "House": "home",
"Townhouse": "home", "Mobile Home": "home", "Manufactured": "home",
"Cabin": "tree", "Condo": "building", "Condominium": "building",
"Apartment": "building", "Multi-Family": "building", "Duplex": "building",
"Triplex": "building", "Land": "land", "Lot": "land", "Farm": "leaf",
"Ranch": "leaf", "Commercial": "cart",
};
/** Fallback image per property type (green gradient + icon + label). */
export function TypeFallback({ type, label = true }: { type?: string; label?: boolean }) {
const ico = TYPE_ICONS[type ?? ""] ?? "home";
return (
{label && {type || "Photos coming soon"}}
);
}
/**
that switches to the type fallback if loading fails. */
export default function PropertyImg({
src, alt, type, eager = false,
}: { src?: string | null; alt: string; type?: string; eager?: boolean }) {
const [broken, setBroken] = useState(false);
if (!src || broken) return ;
return (
setBroken(true)}
/>
);
}