| 1 |
import { InspectorControls } from '@wordpress/block-editor'; |
| 2 |
import { |
| 3 |
__experimentalUnitControl as UnitControl, |
| 4 |
PanelBody, |
| 5 |
} from '@wordpress/components'; |
| 6 |
import { __ } from '@wordpress/i18n'; |
| 7 |
|
| 8 |
import IconPicker from '../../../components/icon-picker'; |
| 9 |
|
| 10 |
export default function EditInspectorControls({ attributes, setAttributes }) { |
| 11 |
const { icon, width } = attributes; |
| 12 |
|
| 13 |
return ( |
| 14 |
<InspectorControls> |
| 15 |
<PanelBody> |
| 16 |
<IconPicker |
| 17 |
label={__('Icon', 'ghostkit')} |
| 18 |
value={icon} |
| 19 |
onChange={(value) => setAttributes({ icon: value })} |
| 20 |
insideInspector |
| 21 |
/> |
| 22 |
<UnitControl |
| 23 |
label={__('Width', 'ghostkit')} |
| 24 |
placeholder={__('Auto', 'ghostkit')} |
| 25 |
value={width} |
| 26 |
onChange={(val) => setAttributes({ width: val })} |
| 27 |
labelPosition="edge" |
| 28 |
__unstableInputWidth="70px" |
| 29 |
min={0} |
| 30 |
/> |
| 31 |
</PanelBody> |
| 32 |
</InspectorControls> |
| 33 |
); |
| 34 |
} |
| 35 |
|