import { useParams, useNavigate } from 'react-router-dom'; import { useEffect } from 'react'; import { DocPageShell } from '../components/DocLayout/DocPageShell'; import { DocTableOfContents } from '../components/DocLayout/DocTableOfContents'; import { DocSectionCard } from '../components/DocLayout/DocSectionCard'; import { getRoleBySlug } from '../data/roles'; import { DOC_SECTIONS } from '../data/docSections'; import { useFlowStore } from '../store/useFlowStore'; import { Icon } from '../components/shared/Icon'; import type { StakeholderView } from '../data/types'; export function StakeholderDocPage() { const { roleSlug } = useParams<{ roleSlug: string }>(); const navigate = useNavigate(); const setStakeholderView = useFlowStore((s) => s.setStakeholderView); const role = getRoleBySlug(roleSlug ?? ''); useEffect(() => { if (role) { setStakeholderView(role.slug as StakeholderView); } }, [role, setStakeholderView]); if (!role) { return (

Unknown role: {roleSlug}

); } const sections = role.sectionIds .map((id) => DOC_SECTIONS[id]) .filter(Boolean); const tocItems = sections.map((s) => ({ id: s.id, title: s.title, icon: s.icon })); return ( navigate('/')} className="flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors" style={{ background: `${role.color}20`, color: role.color }} onMouseEnter={(e) => (e.currentTarget.style.background = `${role.color}30`)} onMouseLeave={(e) => (e.currentTarget.style.background = `${role.color}20`)} > Open Visualizer } sidebar={ } >
{sections.map((section) => { const Component = section.component; return ( ); })}
); }