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,parent_index,data}:{index:number ,parent_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} parent_index={parent_index} type="TextArea" />
        <File className="file_exercise" label={"attachment"}  name={index} type="File" parent_index={parent_index} />
    
        <CheckboxField className="" label="The_correct_answer"  name={index} type="Checkbox" parent_index={parent_index} />

      </div>
  )
}

export default ChoiceFields