@wordpress/block-library
Version:
Block library for the WordPress editor.
31 lines (29 loc) • 766 B
JavaScript
/**
* WordPress dependencies
*/
import { SelectControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/block-editor';
export default function CommentsInspectorControls( {
attributes: { TagName },
setAttributes,
} ) {
return (
<InspectorControls>
<InspectorControls __experimentalGroup="advanced">
<SelectControl
label={ __( 'HTML element' ) }
options={ [
{ label: __( 'Default (<div>)' ), value: 'div' },
{ label: '<section>', value: 'section' },
{ label: '<aside>', value: 'aside' },
] }
value={ TagName }
onChange={ ( value ) =>
setAttributes( { tagName: value } )
}
/>
</InspectorControls>
</InspectorControls>
);
}