import source from './roundabout.json'; import type { Meta, StoryObj } from '@storybook/react'; import { useMemo, useState } from 'react'; import { getArticulationState } from '../../../utils/getArticulationState'; import { Orchestrator } from '../../utils/Orchestrator'; type Source = Parameters[0]; type Data = Parameters[1]; type Props = { source: Source; data: Data; }; function StoryComponent({ source, data }: Props) { const [page, setPage] = useState(null as null | string); const gotoNav = () => setPage(null); const { items } = useMemo( () => getArticulationState(source, data), [source, data] ); if (page) { return (
{page} {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */} {/*/ @ts-ignore */}
); } const progressLabel = (n: number) => { if (n === -1) { return 'Commencer'; } if (n === 0) { return 'Continuer'; } return 'Complété'; }; return (

Articulation

{items[0].cells.map((cell, k) => ( ))} {items.map((item, k) => ( {item.cells.map((cell, kk) => ( ))} ))}
{cell.label}Actions
{cell.value}
); } const meta: Meta = { title: 'Behaviour/Articulation', component: StoryComponent, }; export default meta; type Story = StoryObj; export const Basic: Story = { args: { source: source as Source, data: {}, }, };