import { useParams, useNavigate } from 'react-router-dom'; import { useMemo, useState } from 'react'; import { PATHS } from '../data/paths'; import { useFlowStore } from '../store/useFlowStore'; import { Icon } from '../components/shared/Icon'; export function SubPathDetailPage() { const { pathId } = useParams<{ pathId: string }>(); const navigate = useNavigate(); const selectPath = useFlowStore((s) => s.selectPath); const [activeTab, setActiveTab] = useState(0); const path = useMemo(() => { const id = parseInt(pathId || '0'); return PATHS.find((p) => p.id === id); }, [pathId]); if (!path) { return (

Path Not Found

); } const subPaths = path.subPaths || []; const currentSubPath = subPaths[activeTab]; const steps = currentSubPath?.steps || path.steps; return (
{/* Header */}
Path {path.id}

{path.label}

{path.description}

{/* Sub-path tabs */} {subPaths.length > 0 && (
{subPaths.map((sub, idx) => ( ))}
)} {/* Content Grid */}
{/* Left: System State & Side Effects Table */}
{/* System State */}

System State Visualization

{steps[0]?.activeComponents.slice(0, 3).map((compId, idx) => (
{compId.replace(/-/g, ' ')}
Status: {steps[0]?.status}
{idx < 2 && ( )}
))}
{/* Side Effects Table */}

Scenario Side Effects

{steps.map((step) => ( ))}
Step Status Side Effects
{step.title} {step.bookingStatus} {Object.entries(step.sideEffects) .filter(([, v]) => v) .map(([k, v]) => `${k}: ${v}`) .join(', ') || 'None'}
{/* Right: Step Detail Panel */}

Step Detail Panel

{/* Pre-conditions */}

Pre-conditions

    {steps[0] && ( <>
  • Status is {steps[0].status}
  • Trigger: {steps[0].trigger}
  • )}
{/* Critical Logic */}

Critical Logic

{steps[0]?.description || 'No description available.'}

{/* Component Flags */} {steps[0] && (

Component Flags

{steps[0].activeComponents.map((comp) => (
{comp}
ACTIVE
))}
)}
); }