mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
27 lines
547 B
JavaScript
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;
|