import React from 'react' import { PanelLeftClose, PanelLeftOpen, Search } from 'lucide-react' import type { CollectionPlace } from '@trek/shared' import type { TranslationFn } from '../../types' import CollectionMap from './CollectionMap' import CollectionLabelFilter, { type LabelOption } from './CollectionLabelFilter' interface CollectionMapPanelProps { places: CollectionPlace[] selectedPlaceId: number | null onSelect: (id: number) => void onDeselect: () => void dark: boolean /** Render the floating map controls (desktop). Mobile drives view from the toolbar. */ overlay: boolean /** 'list' = split (map can be expanded); 'map' = full (list collapsed). */ view: 'list' | 'map' onToggleView: () => void search: string onSearch: (v: string) => void /** * The label filter rides along in the map's top bar, where there is room for * it. The filter row keeps it whenever no map is on screen, so it can never * become unreachable. */ labelOptions?: LabelOption[] labelFilter?: number[] onLabelFilter?: (ids: number[]) => void canManageLabels?: boolean onManageLabels?: () => void t: TranslationFn } /** * The map surface for the collections page — the map plus its floating controls: * a top-left cluster (collapse/expand the list, toggle bulk-select) and a * top-right search box. Used both in the desktop split and the full-map view. */ export default function CollectionMapPanel({ places, selectedPlaceId, onSelect, onDeselect, dark, overlay, view, onToggleView, search, onSearch, labelOptions = [], labelFilter = [], onLabelFilter, canManageLabels = false, onManageLabels, t, }: CollectionMapPanelProps): React.ReactElement { const showLabels = onLabelFilter != null && (labelOptions.length > 0 || canManageLabels) return (