import { __ } from '@wordpress/i18n'; import { InspectorControls, useBlockProps } from '@wordpress/block-editor'; import { PanelBody, ToggleControl } from '@wordpress/components'; import { useState, useEffect } from '@wordpress/element'; const Edit = ( props ) => { const blockProps = useBlockProps(); const { attributes, setAttributes, context } = props; const { lpCourseData } = context; const courseLevel = lpCourseData?.level || '
All levels
'; return ( <> { setAttributes( { showLabel: value, } ); } } /> { setAttributes( { showIcon: value, } ); } } />
{ attributes.showIcon && ( ' } } /> ) } { attributes.showLabel ? 'Level:' : '' }
); }; export default Edit;