UNPKG

@wordpress/edit-post

Version:
39 lines (32 loc) 1.28 kB
import { createElement } from "@wordpress/element"; /** * WordPress dependencies */ import { Icon, layout } from '@wordpress/icons'; import { useSelect } from '@wordpress/data'; import { Flex, FlexItem, FlexBlock, PanelBody } from '@wordpress/components'; /** * Internal dependencies */ import { store as editPostStore } from '../../../store'; function TemplateSummary() { var _template$title; const template = useSelect(select => { const { getEditedPostTemplate } = select(editPostStore); return getEditedPostTemplate(); }, []); if (!template) { return null; } return createElement(PanelBody, null, createElement(Flex, { align: "flex-start" }, createElement(FlexItem, null, createElement(Icon, { icon: layout })), createElement(FlexBlock, null, createElement("h2", { className: "edit-post-template-summary__title" }, (template === null || template === void 0 ? void 0 : (_template$title = template.title) === null || _template$title === void 0 ? void 0 : _template$title.raw) || (template === null || template === void 0 ? void 0 : template.slug)), createElement("p", null, template === null || template === void 0 ? void 0 : template.description)))); } export default TemplateSummary; //# sourceMappingURL=index.js.map