Conditionally check/uncheck the Order Intent

This commit is contained in:
Narek Zakarian 2025-02-18 16:55:01 +04:00
parent 5059ca24ff
commit 167e12e54e
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7
2 changed files with 16 additions and 1 deletions

View file

@ -1,7 +1,13 @@
import { ToggleControl } from '@wordpress/components';
import { Action, Description } from '../Elements';
const ControlToggleButton = ( { label, description, value, onChange } ) => (
const ControlToggleButton = ( {
label,
description,
value,
onChange,
disabled = false,
} ) => (
<Action>
<ToggleControl
className="ppcp--control-toggle"
@ -12,6 +18,7 @@ const ControlToggleButton = ( { label, description, value, onChange } ) => (
help={
description ? <Description>{ description }</Description> : null
}
disabled={ disabled }
/>
</Action>
);