/** * External dependencies */ import classNames from 'classnames'; import { useInstanceId } from '@wordpress/compose'; /** * Internal dependencies */ import './style.scss'; export type CheckboxControlProps = { className?: string; label?: string | React.ReactNode; id?: string; onChange: ( value: boolean ) => void; children?: React.ReactChildren; hasError?: boolean; checked?: boolean; disabled?: boolean; }; /** * Component used to show a checkbox control with styles. */ export const CheckboxControl = ( { className, label, id, onChange, children, hasError = false, checked = false, disabled = false, ...rest }: CheckboxControlProps ): JSX.Element => { const instanceId = useInstanceId( CheckboxControl ); const checkboxId = id || `checkbox-control-${ instanceId }`; return (