import React from "react"; import { cn } from "@/lib/utils"; import { formatCurrency } from "@/lib/format-currency"; import { Button } from "./button"; import { Plus } from "lucide-react"; export type PropertyCarouselType = "homeLoan" | "property"; export interface PropertyCarouselItem { id: string; address: string; /** Estimated value or equity */ value: number; /** Linked loan balance, if any */ loanBalance?: number; } export interface PropertyListCarouselProps { properties: PropertyCarouselItem[]; type: PropertyCarouselType; /** When provided, shows an "Add Property" button at the end (property type only) */ onAddProperty?: () => void; className?: string; } function PropertyCard({ item }: { item: PropertyCarouselItem }) { return (

{item.address}

{formatCurrency(item.value)}

{item.loanBalance !== undefined && (

Loan: {formatCurrency(item.loanBalance)}

)}
); } export function PropertyListCarousel({ properties, type, onAddProperty, className, }: PropertyListCarouselProps) { const showAddButton = type === "property" && onAddProperty; return (
{properties.map((property) => ( ))} {showAddButton && ( )}
); }