UNPKG

@wordpress/components

Version:
31 lines (30 loc) 1.12 kB
// packages/components/src/custom-select-control-v2/item.tsx import { useContext } from "@wordpress/element"; import { Icon, check } from "@wordpress/icons"; import * as Styled from "./styles"; import { CustomSelectContext } from "./custom-select"; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; function CustomSelectItem({ children, ...props }) { var _customSelectContext$; const customSelectContext = useContext(CustomSelectContext); return /* @__PURE__ */ _jsxs(Styled.SelectItem, { store: customSelectContext?.store, size: (_customSelectContext$ = customSelectContext?.size) !== null && _customSelectContext$ !== void 0 ? _customSelectContext$ : "default", ...props, children: [children !== null && children !== void 0 ? children : props.value, /* @__PURE__ */ _jsx(Styled.SelectedItemCheck, { children: /* @__PURE__ */ _jsx(Icon, { icon: check }) })] }); } CustomSelectItem.displayName = "CustomSelectControlV2.Item"; var item_default = CustomSelectItem; export { CustomSelectItem, item_default as default }; //# sourceMappingURL=item.js.map