import React, { forwardRef } from 'react'; import { useCheckbox } from './CheckboxProvider'; const CheckboxIcon = (StyledCheckboxIcon: any) => forwardRef(({ children, ...props }: any) => { const { isHovered, isChecked, isDisabled, isFocusVisible } = useCheckbox('CheckboxContext'); if (isChecked) return ( {children} ); return null; }); export default CheckboxIcon;