UNPKG

@wordpress/editor

Version:
29 lines (28 loc) 929 B
// packages/editor/src/components/template-actions-panel/index.js import { useSelect } from "@wordpress/data"; import { store as editorStore } from "../../store/index.mjs"; import { usePostTemplatePanelMode } from "../post-template/hooks.mjs"; import BlockThemeContent from "./block-theme-content.mjs"; import ClassicThemeContent from "./classic-theme-content.mjs"; import { jsx } from "react/jsx-runtime"; function TemplateActionsPanel() { const postType = useSelect( (select) => select(editorStore).getCurrentPostType(), [] ); const mode = usePostTemplatePanelMode(); if (!["page", "post"].includes(postType)) { return null; } if (mode === "classic") { return /* @__PURE__ */ jsx(ClassicThemeContent, {}); } if (mode === "block-theme") { return /* @__PURE__ */ jsx(BlockThemeContent, {}); } return null; } export { TemplateActionsPanel as default }; //# sourceMappingURL=index.mjs.map