UNPKG

@wener/console

Version:
14 lines (13 loc) 474 B
import React, { useCallback } from "react"; import { LoadingIndicator } from "../../console/index.js"; import { AuthStatus, useAuthStore } from "./AuthStore.js"; export var AuthReady = function (param) { var children = param.children; var ready = useAuthStore(useCallback(function (s) { return s.status !== AuthStatus.Init; }, [])); if (ready) { return children; } return /*#__PURE__*/ React.createElement(LoadingIndicator, null); };