import { Eye, EyeOff, Layers3, Lock } from "lucide-react"; import { cn } from "@/lib/utils"; import { MAP_COMPACT_RADIUS_CLASS_NAME, MAP_ICON_CELL_RADIUS_CLASS_NAME, MAP_MAJOR_PANEL_RADIUS_CLASS_NAME, MAP_TOOL_PANEL_SURFACE_CLASS_NAME } from "./map-control-styles"; export type MapLayerControlItem = { id: string; label: string; description?: string; visible: boolean; disabled?: boolean; locked?: boolean; }; type MapLayerControlProps = { title?: string; items: MapLayerControlItem[]; onToggleLayer: (id: string, visible: boolean) => void; className?: string; }; export function MapLayerControl({ title = "图层", items, onToggleLayer, className = "" }: MapLayerControlProps) { return (

{title}

{items.filter((item) => item.visible).length}/{items.length} 可见

{items.map((item) => { const Icon = item.visible ? Eye : EyeOff; const disabled = item.disabled || item.locked; return ( ); })}
); }