import { makeStyles } from '@material-ui/core' import classnames from 'classnames' import React from 'react' import { Label1, Info2 } from 'src/components/typography' const styles = { flex: { display: 'flex' }, column: { flexDirection: 'column' }, halfWidth: { width: '50%', marginBottom: 15, marginRight: 50 }, marginTop: { marginTop: 20 }, marginBottom: { marginBottom: 20 } } const useStyles = makeStyles(styles) const DetailsCard = ({ it }) => { const customRequest = it.customRequest const classes = useStyles() const getScreen2Data = () => { const label1Display = customRequest.input.constraintType === 'spaceSeparation' ? 'First word label' : 'Text entry label' switch (customRequest.input.type) { case 'text': return ( <>
{label1Display} {customRequest.input.label1}
{customRequest.input.constraintType === 'spaceSeparation' && (
Second word label {customRequest.input.label2}
)} ) default: return ( <>
Screen 2 input title {customRequest.screen2.title}
Screen 2 input description {customRequest.screen2.text}
) } } const getInputData = () => { return ( <> {customRequest.input.choiceList && ( <> Choices {customRequest.input.choiceList.map((choice, idx) => { return {choice} })} )} {customRequest.input.numDigits && ( <> Number of digits {customRequest.input.numDigits} )} ) } return (
Screen 1 title {customRequest.screen1.title}
{getScreen2Data()}
Screen 1 text {customRequest.screen1.text}
{getInputData()}
) } export default DetailsCard