import { useAsync } from "react-use"; import { MetaResponse, getBackendMeta } from "@/backend/accounts/meta"; import { Button } from "@/components/Button"; import { Icon, Icons } from "@/components/Icon"; import { LargeCard, LargeCardButtons, LargeCardText, } from "@/components/layout/LargeCard"; import { conf } from "@/setup/config"; interface TrustBackendPartProps { onNext?: (meta: MetaResponse) => void; } export function TrustBackendPart(props: TrustBackendPartProps) { const result = useAsync(async () => { const url = conf().BACKEND_URL; return { domain: new URL(url).hostname, data: await getBackendMeta(conf().BACKEND_URL), }; }, []); if (result.loading) return
loading...
; if (result.error || !result.value) returnFailed to talk to backend, did you configure it correctly?
; return ({result.value.data.description}
) : null}