import { useEffect } from 'react' import { useNavigate } from 'react-router-dom' import { AddLayerForm } from '@/components/AddLayerForm' import { PanelHeading, ProceedButton } from '@/components/cockpit/PanelChrome' import { useSession } from '@/store/session' const L2_PREFILL = 'i2c_scan to enumerate both ADXL355Z; matrix_text and matrix_count for on-board readouts; adxl355_stream for live vibration.' const L3_PREFILL = 'Report only on exception; escalate ambiguous or high-consequence calls to the cloud model; never suppress a stale-sensor alarm.' export function Module2() { const navigate = useNavigate() const l2 = useSession((s) => s.add.L2) const l3 = useSession((s) => s.add.L3) const tried = useSession((s) => s.tried) const setAddLayer = useSession((s) => s.setAddLayer) const completePhase = useSession((s) => s.completePhase) const ready = l2.trim().length > 0 && l3.trim().length > 0 // If the team ran the three agent prompts in "Meet your agent", seed Layers 2 & 3 // with a starting draft (only if untouched). useEffect(() => { if (tried < 3) return if (!useSession.getState().add.L2.trim()) setAddLayer('L2', L2_PREFILL) if (!useSession.getState().add.L3.trim()) setAddLayer('L3', L3_PREFILL) }, [tried, setAddLayer]) const onProceed = () => { completePhase('m2') navigate('/workshop/add') } return (
Proceed to Module 3 →
) }