@wordpress/components
Version:
UI components for WordPress.
32 lines (31 loc) • 919 B
JavaScript
// packages/components/src/tools-panel/tools-panel-item/component.tsx
import { useToolsPanelItem } from "./hook";
import { View } from "../../view";
import { contextConnect } from "../../context";
import { jsx as _jsx } from "react/jsx-runtime";
var 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
});
};
var ToolsPanelItem = contextConnect(UnconnectedToolsPanelItem, "ToolsPanelItem");
var component_default = ToolsPanelItem;
export {
ToolsPanelItem,
component_default as default
};
//# sourceMappingURL=component.js.map