import { MAX_ANSWER_LENGTH } from 'common/answer' import { XIcon } from '@heroicons/react/solid' import { Col } from '../layout/col' import { Row } from '../layout/row' import { ExpandingInput } from '../expanding-input' export function MultipleChoiceAnswers(props: { answers: string[] setAnswers: (answers: string[]) => void }) { const { answers, setAnswers } = props const setAnswer = (i: number, answer: string) => { const newAnswers = setElement(answers, i, answer) setAnswers(newAnswers) } const removeAnswer = (i: number) => { const newAnswers = answers.slice(0, i).concat(answers.slice(i + 1)) setAnswers(newAnswers) } const addAnswer = () => setAnswer(answers.length, '') return (