import React, { useState, useEffect } from 'react';
import { InputRadio } from '../../../../../UI'
type RadioButtonProps = {
    updateData: (value: number) => void;
    masImg: string[],
  }

export const RadioButton: React.FC<RadioButtonProps> = ({masImg, updateData }) => {
    const [variable, setVariable] = useState<number>(0);

    const inputHandler = (event: React.ChangeEvent<HTMLInputElement>) => {
        const value:string = event.target.value;
        console.log(value);
        //setVariable(value);
        //updateData(value);
      };

    return(
        <div className='fieldset'>
            {masImg.map((name, num) =>
                <InputRadio
                    key={name}
                    num={num}
                    variable={variable}
                    onChange={() => inputHandler}
                    label={''}
                    value={0} />
            )}
        </div>
    )
}