// @flow
import { Checkbox } from '@atlaskit/checkbox';
import React from 'react';
import { isSubmitAnswerDisabled } from '../../functions';
import AbstractPollAnswer from '../AbstractPollAnswer';
import type { AbstractProps } from '../AbstractPollAnswer';
const PollAnswer = (props: AbstractProps) => {
const {
creatorName,
checkBoxStates,
poll,
setCheckbox,
skipAnswer,
skipChangeVote,
submitAnswer,
t
} = props;
const { changingVote } = poll;
return (
{ poll.question }
{ t('polls.by', { name: creatorName }) }
{
poll.answers.map((answer, index) => (
{ answer.name } }
// eslint-disable-next-line react/jsx-no-bind
onChange = { ev => setCheckbox(index, ev.target.checked) }
size = 'large' />
))
}
{t('polls.answer.skip')}
{t('polls.answer.submit')}
);
};
/*
* 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);