@wordpress/components
Version:
UI components for WordPress.
31 lines (30 loc) • 774 B
JavaScript
// packages/components/src/query-controls/author-select.tsx
import { buildTermsTree } from "./terms";
import TreeSelect from "../tree-select";
import { jsx as _jsx } from "react/jsx-runtime";
function AuthorSelect({
__next40pxDefaultSize,
label,
noOptionLabel,
authorList,
selectedAuthorId,
onChange: onChangeProp
}) {
if (!authorList) {
return null;
}
const termsTree = buildTermsTree(authorList);
return /* @__PURE__ */ _jsx(TreeSelect, {
label,
noOptionLabel,
onChange: onChangeProp,
tree: termsTree,
selectedId: selectedAuthorId !== void 0 ? String(selectedAuthorId) : void 0,
__nextHasNoMarginBottom: true,
__next40pxDefaultSize
});
}
export {
AuthorSelect as default
};
//# sourceMappingURL=author-select.js.map