import React from 'react'
import { Choice } from '../../../../types/Item'
import ValidationField from '../../../../Components/ValidationField/ValidationField'
import { useFormikContext } from 'formik';
import { useTranslation } from 'react-i18next';
import { getCharFromNumber } from '../../../../utils/getCharFromNumber';
import CheckboxField from './CheckboxField';
import TextField from './TextField';
import File from './File';

const ChoiceFields = ({index,data}:{index:number , data :Choice }) => {
  const formik = useFormikContext();

    const [t] = useTranslation()
  return (
    <div className='ChoiceFields'>
      
      
      <TextField className="textarea_exercise" placeholder={"choice"} label2={t(`input.choice`)  + ` ` + `(${(getCharFromNumber(index))})` } name={index} id={`choice_${index}`} type="TextArea" />
        <File className="file_exercise" label={"attachment"}  name={index} type="File" />
    
        <CheckboxField className="" label="The_correct_answer"  name={index} type="Checkbox" />

      </div>
  )
}

export default ChoiceFields