// Workstation shell — top bar, ribbon, panels, canvas, status bar const { useState: useS, useEffect: useE } = React; function Workstation() { const [activeTool, setActiveTool] = useS('select'); const [viewMode, setViewMode] = useS('2d'); // 2d | 3d | globe const [basemap, setBasemap] = useS('streets'); const [selected, setSelected] = useS(null); const [hovered, setHovered] = useS(null); const [cursor, setCursor] = useS({ lat: 20.5, lon: 78.9, x: 300, y: 400 }); const [layers, setLayers] = useS({ states: { on: true }, districts: { on: true }, cities: { on: true }, labels: { on: true }, rivers: { on: true }, roads: { on: true }, assets: { on: true }, ai: { on: true }, buffer: { on: true }, routes: { on: true }, heatmap: { on: false }, graticule: { on: true }, }); // Sync 3D/globe tool with view mode useE(() => { if (activeTool === '3d') setViewMode('3d'); if (activeTool === 'globe') setViewMode('globe'); if (['select','pan','zoom','measure','draw','polygon','vertex'].includes(activeTool) && viewMode !== '2d') { // Keep it if user is doing analysis; only reset via basemap explicitly. } }, [activeTool]); // Command hint for the active tool const toolHints = { select: { lbl: 'SELECT', desc: 'Click any feature to inspect · Shift-click to multi-select', kbd: 'S' }, pan: { lbl: 'PAN', desc: 'Drag to move the map view', kbd: 'P' }, zoom: { lbl: 'ZOOM', desc: 'Draw a rectangle to zoom in', kbd: 'Z' }, measure: { lbl: 'MEASURE',desc: 'Click points to measure distance and area', kbd: 'M' }, draw: { lbl: 'DRAW', desc: 'Click to add vertices · double-click to finish', kbd: 'D' }, polygon: { lbl: 'POLYGON',desc: 'Create polygon feature with snapping enabled', kbd: 'G' }, vertex: { lbl: 'VERTEX', desc: 'Edit individual vertices of a selected feature', kbd: 'V' }, buffer: { lbl: 'BUFFER', desc: 'Generate 5/10/15 km buffer around a selection', kbd: 'B' }, overlay: { lbl: 'OVERLAY',desc: 'Intersect selected layers · output as new feature class', kbd: 'O' }, route: { lbl: 'ROUTE', desc: 'Compute shortest / least-cost path between origins', kbd: 'R' }, chart: { lbl: 'CHARTS', desc: 'Open chart designer for selected layer', kbd: 'C' }, aidet: { lbl: 'AI DETECT', desc: 'Run object detection on active imagery layer', kbd: 'A' }, segm: { lbl: 'AI SEGMENT', desc: 'Semantic segmentation via Segment Anything · U-Net', kbd: 'S' }, sat: { lbl: 'IMAGERY',desc: 'Load Sentinel / Landsat / ISRO Bhuvan tiles', kbd: 'I' }, drone: { lbl: 'DRONE', desc: 'Ingest orthomosaic · DEM · point cloud from UAV mission', kbd: 'U' }, '3d': { lbl: '3D VIEW',desc: 'Perspective tilt · terrain and buildings extruded', kbd: '3' }, globe: { lbl: 'GLOBE', desc: 'Spherical projection · full earth view', kbd: 'G' }, }; const hint = toolHints[activeTool]; return (