import { useState } from 'react'
import { IconMapPinFilled, IconTrash, IconMapPin, IconX } from '@tabler/icons-react'
import { PIN_COLORS } from '~/hooks/useMapMarkers'
import type { MapMarker } from '~/hooks/useMapMarkers'
interface MarkerPanelProps {
markers: MapMarker[]
onDelete: (id: number) => void
onFlyTo: (longitude: number, latitude: number) => void
onSelect: (id: number | null) => void
selectedMarkerId: number | null
}
export default function MarkerPanel({
markers,
onDelete,
onFlyTo,
onSelect,
selectedMarkerId,
}: MarkerPanelProps) {
const [open, setOpen] = useState(false)
if (!open) {
return (
)
}
return (
{/* Header */}
Saved Locations
{markers.length > 0 && (
{markers.length}
)}
{/* Marker list */}
{markers.length === 0 ? (
Click anywhere on the map to drop a pin
) : (
{markers.map((marker) => (
-
c.id === marker.color)?.hex ?? '#a84a12' }}
/>
))}
)}
)
}