summaryrefslogtreecommitdiff
path: root/web/src/components/ComponentOrLoading.tsx
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2023-10-27 20:24:13 +1100
committerJames Elliott <james-d-elliott@users.noreply.github.com>2024-03-04 20:28:24 +1100
commit87d2a3419d6f29db900bc1aeb4cf5d7769a15ce3 (patch)
treea4efff47cb7be04f9fb1ce344cb9e40f4096dee6 /web/src/components/ComponentOrLoading.tsx
parentc0dbdd97ab2ac580e3da07a0137dbc7a1b9c9b83 (diff)
feat(web): user one-time password preferences
This allows administrators to configure a list of Time-based One-Time Password parameters that users can pick from the web UI during registrations. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Diffstat (limited to 'web/src/components/ComponentOrLoading.tsx')
-rw-r--r--web/src/components/ComponentOrLoading.tsx22
1 files changed, 22 insertions, 0 deletions
diff --git a/web/src/components/ComponentOrLoading.tsx b/web/src/components/ComponentOrLoading.tsx
new file mode 100644
index 000000000..2ff6948cf
--- /dev/null
+++ b/web/src/components/ComponentOrLoading.tsx
@@ -0,0 +1,22 @@
+import React, { Fragment, ReactNode } from "react";
+
+import LoadingPage from "@views/LoadingPage/LoadingPage";
+
+export interface Props {
+ ready: boolean;
+
+ children: ReactNode;
+}
+
+const ComponentOrLoading = function (props: Props) {
+ return (
+ <Fragment>
+ <div className={props.ready ? "hidden" : ""}>
+ <LoadingPage />
+ </div>
+ {props.ready ? props.children : null}
+ </Fragment>
+ );
+};
+
+export default ComponentOrLoading;