diff --git a/src/components/association/GoogleMapPicker.tsx b/src/components/association/GoogleMapPicker.tsx index b203331..a07c993 100644 --- a/src/components/association/GoogleMapPicker.tsx +++ b/src/components/association/GoogleMapPicker.tsx @@ -14,6 +14,7 @@ export interface MapPinData { lng: string; status: "available" | "unavailable"; linked_amenity_id?: string; + amount?: number; } interface Props { @@ -28,9 +29,11 @@ interface Props { linkLabel?: string; /** When true, the link dropdown shows regardless of pin status. */ allowLinkAnyStatus?: boolean; + /** When true, each pin gets a per-pin amount ($) field. */ + showAmount?: boolean; } -export default function GoogleMapPicker({ pins, onChange, zoom = 16, onZoomChange, formAmenities, lockedView, onLockedViewChange, linkLabel = "form", allowLinkAnyStatus = false }: Props) { +export default function GoogleMapPicker({ pins, onChange, zoom = 16, onZoomChange, formAmenities, lockedView, onLockedViewChange, linkLabel = "form", allowLinkAnyStatus = false, showAmount = false }: Props) { const mapRef = useRef(null); const mapInstance = useRef(null); const markersRef = useRef([]); @@ -237,6 +240,21 @@ export default function GoogleMapPicker({ pins, onChange, zoom = 16, onZoomChang
{pin.lat}, {pin.lng}
+ {showAmount && ( +
+ $ + updatePin(pin.id, { amount: e.target.value === "" ? undefined : Number(e.target.value) })} + className="text-sm h-8 w-[130px]" + /> + / mo +
+ )}
{ setSelectedMapAmenityId(v); applyAmenityToMap(mapAmenities.find(a => a.id === v)); }}> + + {mapAmenities.map(a => {a.name})} + + )} + +
- ({ id: u.id, name: `Unit ${u.unit_number}` }))} - /> + {mapAmenities.length === 0 ? ( +

+ No active Map amenity for this association. Create or activate a Map amenity in the association's Amenities, then manage its lot pins here. +

+ ) : ( + ({ id: u.id, name: `Unit ${u.unit_number}` }))} + /> + )}