UNPKG

@wordpress/editor

Version:
42 lines (38 loc) 1.19 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _data = require("@wordpress/data"); var _postTypeSupportCheck = _interopRequireDefault(require("../post-type-support-check")); var _store = require("../../store"); var _jsxRuntime = require("react/jsx-runtime"); /** * WordPress dependencies */ /** * Internal dependencies */ function PostFormatCheck({ children }) { const disablePostFormats = (0, _data.useSelect)(select => select(_store.store).getEditorSettings().disablePostFormats, []); if (disablePostFormats) { return null; } return /*#__PURE__*/(0, _jsxRuntime.jsx)(_postTypeSupportCheck.default, { supportKeys: "post-formats", children: children }); } /** * Component check if there are any post formats. * * @param {Object} props The component props. * @param {Element} props.children The child elements to render. * * @return {Component|null} The rendered component or null if post formats are disabled. */ var _default = exports.default = PostFormatCheck; //# sourceMappingURL=check.js.map