Liferay.Loader.define("@liferay/analytics-settings-web@5.0.47/js/components/StateRenderer",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/empty-state","liferay!frontend-js-react-web$react","../utils/constants","./Loading"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorStateComponent=function ErrorStateComponent({className:e,disabled:t,onClickRefetch:r}){return l.default.createElement("div",{className:e},l.default.createElement(a.default,{className:"text-center",description:"",title:i.ERROR_MESSAGE},r&&l.default.createElement(n.default,{disabled:t,displayType:"secondary",onClick:r},Liferay.Language.get("try-again"))))},t.EmptyStateComponent=function EmptyStateComponent({children:e,className:t,description:r,imgSrc:n,title:i}){return l.default.createElement("div",{className:t},l.default.createElement(a.default,{description:r,imgProps:{alt:i,title:i},imgSrc:n,title:i},e))},t.default=void 0;var n=_interopRequireDefault(r("@frontend-taglib-clay$clayui/button")),a=_interopRequireDefault(r("@frontend-taglib-clay$clayui/empty-state")),l=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 r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var l=n?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),i=r("../utils/constants"),o=_interopRequireDefault(r("./Loading"));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=(0,l.createContext)({empty:!1,error:!1,loading:!1}),StateRenderer=({children:t,empty:r,error:n,loading:a,loadingProps:i})=>a?l.default.createElement(o.default,i):l.default.createElement(e.Provider,{value:{empty:r,error:n,loading:a}},t),EmptyState=({children:t})=>{const{empty:r,error:n,loading:a}=(0,l.useContext)(e);return n||a||!r?null:l.default.createElement(l.default.Fragment,null,t)},ErrorState=({children:t})=>{const{error:r,loading:n}=(0,l.useContext)(e);return!n&&r?l.default.createElement(l.default.Fragment,null,t):null},SuccessState=({children:t})=>{const{empty:r,error:n,loading:a}=(0,l.useContext)(e);return n||a||r?null:l.default.createElement(l.default.Fragment,null,t)};StateRenderer.Empty=EmptyState,StateRenderer.Error=ErrorState,StateRenderer.Success=SuccessState;var u=StateRenderer;t.default=u}}));
//# sourceMappingURL=StateRenderer.js.map