/* ===== App shell — sidebar nav + screen router ===== */ const NAV = [ { sec: 'Workspace', items: [ { id: 'home', label: 'Home', icon: 'home' }, { id: 'dashboard', label: 'Dashboard', icon: 'history', count: '42' }, { id: 'sku', label: 'SKU library', icon: 'sku', count: '2.1k' }, ]}, { sec: 'Modules', items: [ { id: 'cartonization', label: 'Cartonization', icon: 'carton' }, { id: 'palletization', label: 'Palletization', icon: 'pallet' }, { id: 'containerization', label: 'Containerization', icon: 'container', count: '●' }, ]}, { sec: 'Outputs', items: [ { id: 'reports', label: 'Reports', icon: 'report' }, { id: 'settings', label: 'Rules & settings', icon: 'settings' }, ]}, ]; const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "showStopOption": true }/*EDITMODE-END*/; const App = () => { const [screen, setScreen] = React.useState('home'); const [excelOpen, setExcelOpen] = React.useState(false); const [t, setTweak] = useTweaks(TWEAK_DEFAULTS); const navigate = (s) => setScreen(s); let screenEl = null; switch (screen) { case 'home': screenEl = ; break; case 'dashboard': screenEl = ; break; case 'sku': screenEl = setExcelOpen(true)}/>; break; case 'cartonization': screenEl = ; break; case 'palletization': screenEl = ; break; case 'containerization': screenEl = setExcelOpen(true)} showStopOption={t.showStopOption}/>; break; case 'reports': screenEl = ; break; case 'settings': screenEl = setExcelOpen(true)}/>; break; default: screenEl = ; } const screenLabel = (() => { for (const sec of NAV) for (const it of sec.items) if (it.id === screen) return it.label; return '—'; })(); return (
{/* Brand block (top-left) */}
MOJRO v2.4
{/* Top bar */}
Load builder / {screenLabel}
⌘K
{/* Sidebar */} {/* Main */}
{screenEl}
{/* Excel modal */} setExcelOpen(false)} onConfirm={() => setExcelOpen(false)}/> {/* Tweaks panel */} setTweak('showStopOption', v)} />
); }; const BrandIcon = () => ( /* Stylised stack of cubes — nods to Mojro logo */ ); const root = ReactDOM.createRoot(document.getElementById('root')); root.render();