import { useAsync } from "react-use"; import { MetaResponse, getBackendMeta } from "@/backend/accounts/meta"; import { Button } from "@/components/Button"; 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) return

Failed to talk to backend, did you configure it correctly?

; return (

do you trust{" "} {result.value.domain}

{result.value.data.name}

{result.value.data.description ? (

{result.value.data.description}

) : null}
); }