import {checkIcon} from '../assets/icons/remastered'
interface CheckBoxProps{
    disable?: boolean,
    checked: boolean,
    index : any,
    handleCheck?: any
}
const CheckBox = ({disable, checked, index, handleCheck} : CheckBoxProps) => {
    return (
    <div tabIndex={disable ? undefined : -1} id={`check-${index}`} className={`custom-checkbox ${disable ? 'disable' : ''}`} onClick={ disable ? ()=>{} : (e)=>{
        handleCheck(!checked)
        document.getElementById(`check-${index}`)?.focus();
        }}>
        {
            checked ? 
            <img className="check" height={14} width={14} src={checkIcon}/>
            : ''
        }
        </div>
    )
}

export default CheckBox