import './index.less';
import {Checkbox as TCheckbox} from 'tdesign-react';
import {useState} from 'react'

export default function (props) {
    const {checked} = props;
    const [myChecked, setChecked] = useState(checked ?? false);
    const onChange = (value: boolean) => {
        setChecked(value);
        if (props.onChange) {
            props.onChange(value);
        }
    }
    return (
        <TCheckbox className={'reset-t-checkbox'} checked={myChecked} onChange={onChange}></TCheckbox>
    )
}
