Server IP : 172.67.158.161 / Your IP : 18.224.64.10 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/home/giankuin/sieuthiweb.com.vn/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/base/components/checkbox-control/ |
Upload File : |
/** * External dependencies */ import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id'; import PropTypes from 'prop-types'; import classNames from 'classnames'; /** * Internal dependencies */ import './style.scss'; /** * Component used to show a checkbox control with styles. */ const CheckboxControl = ( { className, label, id, instanceId, onChange, ...rest } ) => { const checkboxId = id || `checkbox-control-${ instanceId }`; return ( <label className={ classNames( 'wc-block-components-checkbox', className ) } htmlFor={ checkboxId } > <input id={ checkboxId } className="wc-block-components-checkbox__input" type="checkbox" onChange={ ( event ) => onChange( event.target.checked ) } { ...rest } /> <span className="wc-block-components-checkbox__label"> { label } </span> </label> ); }; CheckboxControl.propTypes = { className: PropTypes.string, label: PropTypes.string, id: PropTypes.string, onChange: PropTypes.func, }; export default withInstanceId( CheckboxControl );