import { useFormikContext } from 'formik'
import { FaPlus } from 'react-icons/fa'
import { emptyVariant, InitialValuesProductType } from '../../formUtil'

const AddIcon = () => {
    const {values,setFieldValue} = useFormikContext<InitialValuesProductType>()

    const handleClick = ()=>{         
        setFieldValue("variant",
            [...values?.variant,
              emptyVariant

            ]
        )
        
        }

  return (
    <FaPlus  size={20} onClick={()=> handleClick()}/>

  )
}

export default AddIcon