import { useTwinStore } from '../../lib/twin/store'
import type { LayerKey } from '../../lib/twin/store'
import { BASEMAPS } from '../../lib/twin/basemaps'
import {
Eye,
EyeOff,
Type,
Route,
Square,
Building2,
Droplets,
Trees,
Box,
Layers,
} from 'lucide-react'
// Layer toggle rows shown under the basemap list. 3D rows sit at the bottom.
const LAYER_ROWS: Array<{ key: LayerKey; label: string; icon: React.ReactNode }> = [
{ key: 'label', label: 'Label', icon: },
{ key: 'road', label: 'Road', icon: },
{ key: 'border', label: 'Border', icon: },
{ key: 'building', label: 'Building', icon: },
{ key: 'water', label: 'Water', icon: },
{ key: 'land', label: 'Land', icon: },
{ key: 'building3d', label: '3D Building', icon: },
{ key: 'road3d', label: '3D Road', icon: },
]
/**
* Map view of the left panel: choose the basemap style (kepler-style list with
* swatches) and toggle which basemap layers are visible, including extruded 3D
* buildings/roads. All wired to the store; the map applies the changes live.
*/
export function MapPanel() {
const basemapId = useTwinStore((s) => s.basemapId)
const setBasemap = useTwinStore((s) => s.setBasemap)
const layers = useTwinStore((s) => s.layers)
const toggleLayer = useTwinStore((s) => s.toggleLayer)
return (
{/* Base map styles */}
Base map
{BASEMAPS.map((b) => {
const active = b.id === basemapId
return (
)
})}
{/* Layer toggles */}
Map layers
{LAYER_ROWS.map((row) => {
const on = layers[row.key]
return (
)
})}
)
}
function SectionLabel({ children, className }: { children: React.ReactNode; className?: string }) {
return (
{children}
)
}