UNPKG

@wordpress/editor

Version:
33 lines (31 loc) 938 B
/** * WordPress dependencies */ import { useSelect } from '@wordpress/data'; /** * Internal dependencies */ import PostTypeSupportCheck from '../post-type-support-check'; import { store as editorStore } from '../../store'; /** * Component check if there are any post formats. * * @param {Object} props The component props. * @param {React.ReactNode} props.children The child elements to render. * * @return {React.ReactNode} The rendered component or null if post formats are disabled. */ import { jsx as _jsx } from "react/jsx-runtime"; export default function PostFormatCheck({ children }) { const disablePostFormats = useSelect(select => select(editorStore).getEditorSettings().disablePostFormats, []); if (disablePostFormats) { return null; } return /*#__PURE__*/_jsx(PostTypeSupportCheck, { supportKeys: "post-formats", children: children }); } //# sourceMappingURL=check.js.map