import { Theme } from '@mui/material'; import React from 'react'; import { makeStyles } from 'tss-react/mui'; import Button from '../../../base/ui/components/web/Button'; import Checkbox from '../../../base/ui/components/web/Checkbox'; import { BUTTON_TYPES } from '../../../base/ui/constants.web'; import { isSubmitAnswerDisabled } from '../../functions'; import AbstractPollAnswer, { AbstractProps } from '../AbstractPollAnswer'; const useStyles = makeStyles()((theme: Theme) => { return { buttonMargin: { marginRight: theme.spacing(2) } }; }); const PollAnswer = ({ creatorName, checkBoxStates, poll, setCheckbox, skipAnswer, skipChangeVote, submitAnswer, t }: AbstractProps) => { const { changingVote } = poll; const { classes: styles } = useStyles(); return (
{ poll.question }
{ t('polls.by', { name: creatorName }) }
    { poll.answers.map((answer: any, index: number) => (
  1. setCheckbox(index, ev.target.checked) } />
  2. )) }
); }; /* * We apply AbstractPollAnswer to fill in the AbstractProps common * to both the web and native implementations. */ // eslint-disable-next-line new-cap export default AbstractPollAnswer(PollAnswer);