// VMAX Store Manager — first-run onboarding checklist (the spine of standing up the shop). (function () { const DS = window.VMAX365DesignSystem_0f78b2; const { Button, Badge } = DS; const { Icon } = window.VMAXUI; const { TextInput, pushToast } = window.VMAXW; const { useVMAX, onboardingDone, missingRecipes } = window.VMAXStore; function Onboarding({ mobile, go }) { const [s, a] = useVMAX(); const od = onboardingDone(s); const missingR = missingRecipes(s); const [locEdit, setLocEdit] = React.useState(false); const [names, setNames] = React.useState(s.locations.map((l) => l.name)); const steps = [ { key: 'owner', title: 'Create the owner', sub: 'The root account — done when you first opened the app.', done: true, locked: true }, { key: 'locations', title: 'Confirm your locations', sub: s.locations.map((l) => l.name).join(' · '), done: s.onboarding.locations }, { key: 'people', title: 'Add your people', sub: od.people ? 'At least one cashier can sign in' : 'Add the staff who use the till', done: od.people, go: 'people' }, { key: 'menu', title: 'Build your menu', sub: s.menu.length ? `${s.menu.length} items with prices` : 'Bulk-paste it, set both price tiers', done: od.menu, go: 'catalogue' }, { key: 'stock', title: 'Add your stock', sub: od.stock ? 'Opening levels in' : 'Receive a delivery or run an opening count', done: od.stock, go: 'receiving' }, { key: 'recipes', title: 'Set your recipes', sub: missingR.length ? `${missingR.length} drink${missingR.length > 1 ? 's' : ''} still need a recipe before they deduct stock` : (s.menu.length ? 'Every sellable drink has a recipe' : 'Link each drink to its ingredients'), done: od.recipes, go: 'recipes' }, ]; const doneCount = steps.filter((x) => x.done).length; const ready = od.ready; return (
{doneCount}/{steps.length}

Let's stand up the shop

Do these in any order — the order below is just the easy path. Nothing here is a wall; you can trade before it's all done.

{steps.map((st) => (
{st.done ? : }
{st.title}
{st.sub}
{st.key === 'locations' && locEdit && (
{names.map((nm, i) => setNames((a) => a.map((x, k) => k === i ? v : x))} style={{ padding: '8px 10px' }} />)}
)}
{st.locked ? root : st.key === 'locations' ? (!locEdit && ) : }
))}
{ready ? "You're ready to trade" : 'Almost there'}
{ready ? 'A cashier, a priced menu and stock are in. Open the POS whenever you like.' : 'You need at least a cashier, a priced menu, and some stock before the till is useful.'}
); } window.VMAXONBOARD = { Onboarding }; })();