// @flow import React from 'react'; import { Switch, Text, View } from 'react-native'; import { Button } from 'react-native-paper'; import { BUTTON_MODES } from '../../../chat/constants'; import { isSubmitAnswerDisabled } from '../../functions'; import AbstractPollAnswer from '../AbstractPollAnswer'; import type { AbstractProps } from '../AbstractPollAnswer'; import { chatStyles, dialogStyles } from './styles'; const PollAnswer = (props: AbstractProps) => { const { checkBoxStates, poll, setCheckbox, skipAnswer, submitAnswer, t } = props; return ( { poll.question } {poll.answers.map((answer, index) => ( setCheckbox(index, state) } value = { checkBoxStates[index] } /> {answer.name} ))} ); }; /* * 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);