woocommerce-paypal-payments/modules/ppcp-settings/resources/js/Components/ReusableComponents/Controls/ControlToggleButton.js

27 lines
547 B
JavaScript

import { ToggleControl } from '@wordpress/components';
import { Action, Description } from '../Elements';
const ControlToggleButton = ( {
id = '',
label,
description,
value,
onChange,
disabled = false,
} ) => (
<Action id={ id }>
<ToggleControl
className="ppcp--control-toggle"
__nextHasNoMarginBottom
checked={ value }
onChange={ onChange }
label={ label }
help={
description ? <Description>{ description }</Description> : null
}
disabled={ disabled }
/>
</Action>
);
export default ControlToggleButton;