import React, { useEffect } from "react"; import { headInsert } from "../tools/headInsert"; import { pathJoin } from "../../bin/tools/pathJoin"; import { clsx } from "../tools/clsx"; import type { KcContextBase } from "../getKcContext/KcContextBase"; import type { PageProps } from "./shared/KcProps"; import type { I18nBase } from "../i18n"; export default function LoginOtp(props: PageProps) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { otpLogin, url } = kcContext; const { msg, msgStr } = i18n; useEffect(() => { let isCleanedUp = false; headInsert({ "type": "javascript", "src": pathJoin(kcContext.url.resourcesCommonPath, "node_modules/jquery/dist/jquery.min.js") }).then(() => { if (isCleanedUp) return; evaluateInlineScript(); }); return () => { isCleanedUp = true; }; }, []); return (