import { useMemo } from "react"; import { useHistory } from "react-router-dom"; import { useAsync } from "react-use"; import { MetaResponse, getBackendMeta } from "@/backend/accounts/meta"; import { Button } from "@/components/buttons/Button"; import { Icon, Icons } from "@/components/Icon"; import { LargeCard, LargeCardButtons, LargeCardText, } from "@/components/layout/LargeCard"; import { Loading } from "@/components/layout/Loading"; import { useBackendUrl } from "@/hooks/auth/useBackendUrl"; import { conf } from "@/setup/config"; interface TrustBackendPartProps { onNext?: (meta: MetaResponse) => void; } export function TrustBackendPart(props: TrustBackendPartProps) { const history = useHistory(); const backendUrl = useBackendUrl(); const backendHostname = useMemo( () => new URL(backendUrl).hostname, [backendUrl] ); const result = useAsync(() => { return getBackendMeta(conf().BACKEND_URL); }, [backendUrl]); let cardContent = ( <>
Did you configure it correctly?
> ); if (result.loading) cardContent ={result.value.description}
: null} > ); return (