import React, { FC } from 'react'; import { type QuestionProps } from './types'; import { Flex } from '@cmpsr/components'; import { Height, SingleChoice, MultipleChoice, Numeric } from './questionTypes'; const questionTypesMap = { height: ({ data, answersDispatch }) => , singleChoice: ({ data, answersDispatch }) => , multipleChoice: ({ data, answersDispatch }) => , numeric: ({ data, answersDispatch }) => , }; export const Question: FC = ({ data, answersDispatch }) => { if (!questionTypesMap[data.type]) return null; if (typeof questionTypesMap[data.type] != 'function') return null; return {questionTypesMap[data.type]({ data, answersDispatch })}; };