import React, { Fragment } from 'react'; import { Meta } from '@storybook/react'; import { DecisionTree } from './DecisionTree'; import { Table, Tbody, Td, Th, Thead, Tr } from '@chakra-ui/react'; import { QuestionnaireType, type UseSetupCallbackCB } from './types'; import { questionnaire } from './tests/Questionnaire.mock'; const nextPages = [{ nextSectionId: 1, nextQuestionId: 2 }, { nextSectionId: 2, nextQuestionId: 3 }, null]; const callback = async function (questionId, value) { console.log(questionId, value); return nextPages.shift(); } as UseSetupCallbackCB; export default { component: DecisionTree, title: 'DecisionTree/DecisionTree', argTypes: { variant: { options: ['default'], control: { type: 'select' }, }, size: { options: ['s', 'm', 'l'], control: { type: 'select' }, }, }, } as Meta; const states = ['default', 'filled']; export const All = () => ( {['default'].map((variant, i) => ( {states.map((state, i) => ( {['l'].map((size, i) => ( ))} ))} ))}
Variant State S M L
{variant}
{state}
); const Template = (args) => ; export const Playground = Template.bind({}); Playground.args = { questionnaire, callback, };