Liferay.Loader.define("knowledge-base-web@5.0.98/admin/js/components/TemplatesPanel",["module","exports","require","@frontend-taglib-clay$clayui/core","@frontend-taglib-clay$clayui/empty-state","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/link","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../utils/normalizeItems","./ActionsDropdown"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function TemplatesPanel({items:t,selectedItemId:a}){const o=(0,u.useMemo)((()=>(0,d.default)(t)),[t]);return(null==o?void 0:o.length)?u.default.createElement(r.TreeView,{defaultItems:o,defaultSelectedKeys:new Set([a]),nestedKey:"children",showExpanderOnHover:!1},(t=>u.default.createElement(r.TreeView.Item,{actions:(0,f.default)({actions:t.actions})},u.default.createElement(r.TreeView.ItemStack,{className:(0,c.default)({"knowledge-base-navigation-item-active":t.id===a})},u.default.createElement(i.default,{displayType:"secondary",href:t.href},u.default.createElement(l.default,{symbol:e[t.type]}),u.default.createElement("span",{className:"component-text"},t.name))),u.default.createElement(r.TreeView.Group,{items:t.children},(t=>u.default.createElement(r.TreeView.Item,{actions:(0,f.default)({actions:t.actions}),className:(0,c.default)({"knowledge-base-navigation-item-active":t.id===a})},u.default.createElement(i.default,{displayType:"secondary",href:t.href},u.default.createElement(l.default,{symbol:e[t.type]}),u.default.createElement("span",{className:"component-text"},t.name)))))))):u.default.createElement(n.default,{description:"",imgSrc:"".concat(themeDisplay.getPathThemeImages(),"/states/empty_state.gif"),small:!0,title:Liferay.Language.get("there-are-no-article-templates")})};var r=a("@frontend-taglib-clay$clayui/core"),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/empty-state")),l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/icon")),i=_interopRequireDefault(a("@frontend-taglib-clay$clayui/link")),c=_interopRequireDefault(a("liferay!frontend-js-react-web$classnames")),o=_interopRequireDefault(a("liferay!frontend-js-react-web$prop-types")),u=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=r?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(a,n,l):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),d=_interopRequireDefault(a("../utils/normalizeItems")),f=_interopRequireDefault(a("./ActionsDropdown"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const e={folder:"folder",template:"document-text"};const s={href:o.default.string.isRequired,id:o.default.string.isRequired,name:o.default.string.isRequired,type:o.default.oneOf(Object.keys(e)).isRequired};s.children=o.default.arrayOf(o.default.shape(s))}}));
//# sourceMappingURL=TemplatesPanel.js.map