UNPKG

@wordpress/components

Version:
21 lines (20 loc) • 842 B
import { useToolsPanelItem } from "./hook.mjs"; import { View } from "../../view/index.mjs"; import { contextConnect } from "../../context/index.mjs"; import { jsx } from "react/jsx-runtime"; // packages/components/src/tools-panel/tools-panel-item/component.tsx const UnconnectedToolsPanelItem = (props, forwardedRef) => { const { children, isShown, shouldRenderPlaceholder, ...toolsPanelItemProps } = useToolsPanelItem(props); if (!isShown) return shouldRenderPlaceholder ? /* @__PURE__ */ jsx(View, { ...toolsPanelItemProps, ref: forwardedRef }) : null; return /* @__PURE__ */ jsx(View, { ...toolsPanelItemProps, ref: forwardedRef, children }); }; const ToolsPanelItem = contextConnect(UnconnectedToolsPanelItem, "ToolsPanelItem"); export { ToolsPanelItem, ToolsPanelItem as default }; //# sourceMappingURL=component.mjs.map