UNPKG

@wordpress/block-library

Version:
27 lines (22 loc) 709 B
import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor'; import CommentsInspectorControls from './comments-inspector-controls'; import CommentsLegacy from './comments-legacy'; export default function CommentsEdit( props ) { const { attributes, setAttributes, clientId } = props; const { tagName: TagName, legacy } = attributes; const blockProps = useBlockProps(); const innerBlocksProps = useInnerBlocksProps( blockProps ); if ( legacy ) { return <CommentsLegacy { ...props } />; } return ( <> <CommentsInspectorControls attributes={ attributes } setAttributes={ setAttributes } clientId={ clientId } /> <TagName { ...innerBlocksProps } /> </> ); }