import { LatLng } from "leaflet"; import { MapPinIcon } from "lucide-react"; import { useState } from "react"; import { LocationPicker } from "@/components/map"; import { cn } from "@/lib/utils"; import type { Location } from "@/types/proto/api/v1/memo_service_pb"; import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover"; interface LocationDisplayProps { location?: Location; className?: string; } const LocationDisplay = ({ location, className }: LocationDisplayProps) => { const [popoverOpen, setPopoverOpen] = useState(false); if (!location) { return null; } const displayText = location.placeholder || `Position: [${location.latitude}, ${location.longitude}]`; return (
setPopoverOpen(true)} > [{location.latitude.toFixed(2)}°, {location.longitude.toFixed(2)}°] {displayText}
); }; export default LocationDisplay;