@wordpress/components
Version:
UI components for WordPress.
27 lines (26 loc) • 695 B
JavaScript
import { createElement } from "@wordpress/element";
/**
* Internal dependencies
*/
import { buildTermsTree } from './terms';
import TreeSelect from '../tree-select';
export default function AuthorSelect(_ref) {
let {
label,
noOptionLabel,
authorList,
selectedAuthorId,
onChange: onChangeProp
} = _ref;
if (!authorList) return null;
const termsTree = buildTermsTree(authorList);
return createElement(TreeSelect, {
label,
noOptionLabel,
onChange: onChangeProp,
tree: termsTree,
selectedId: selectedAuthorId !== undefined ? String(selectedAuthorId) : undefined,
__nextHasNoMarginBottom: true
});
}
//# sourceMappingURL=author-select.js.map