import React from 'react';
import { observer } from 'mobx-react-lite';
function _InitialLoadingConditional({ children = null, loadingElement = null, hideLoadingElement, state, }) {
    const { initTask } = state;
    const { status } = initTask;
    const { isLoading, isIdle } = status;
    if (initTask.status.isError) {
        return null;
    }
    if (hideLoadingElement) {
        return React.createElement(React.Fragment, null, children);
    }
    if (isIdle || isLoading) {
        return loadingElement;
    }
    return React.createElement(React.Fragment, null, children);
}
export const InitialLoadingConditional = observer(_InitialLoadingConditional);
//# sourceMappingURL=InitialLoadingConditional.js.map