@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
35 lines (34 loc) • 898 B
JavaScript
/**
* WordPress dependencies
*/
import { MenuItem } from '@wordpress/components';
import { _x } from '@wordpress/i18n';
import { comment as commentIcon } from '@wordpress/icons';
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
/**
* Internal dependencies
*/
import { unlock } from '../../lock-unlock';
import { jsx as _jsx } from "react/jsx-runtime";
const {
CommentIconSlotFill
} = unlock(blockEditorPrivateApis);
const AddCommentButton = ({
onClick
}) => {
return /*#__PURE__*/_jsx(CommentIconSlotFill.Fill, {
children: ({
onClose
}) => /*#__PURE__*/_jsx(MenuItem, {
icon: commentIcon,
onClick: () => {
onClick();
onClose();
},
"aria-haspopup": "dialog",
children: _x('Comment', 'Add comment button')
})
});
};
export default AddCommentButton;
//# sourceMappingURL=comment-button.js.map