import { useEffect, useState } from "react"; import { Card } from "@/components/ui/card"; import { useI18n } from "@/i18n"; import { browse } from "@/lib/browse"; import { asUiError } from "@/lib/api"; export function PublicServerSettings() { const { t } = useI18n(); const [enabled, setEnabled] = useState(null); const [busy, setBusy] = useState(false); const [error, setError] = useState(null); useEffect(() => { void browse.enabled().then(setEnabled).catch(e => setError(asUiError(e).technical)); }, []); async function change(next: boolean) { setBusy(true); setError(null); try { await browse.setEnabled(next); setEnabled(next); } catch (e) { setError(asUiError(e).technical); } finally { setBusy(false); } } return

{t("settings.publicServersHint")}

{error &&

{error}

}
; }