import { useQuery } from '@tanstack/react-query'; import { t } from '../i18n/t'; import { fetchHealth } from '../lib/api'; export function HomePage(): React.JSX.Element { const health = useQuery({ queryKey: ['healthz'], queryFn: fetchHealth, retry: 1 }); return ( <>

{t('home.title', 'Welcome to Dorfteich')}

{t( 'home.intro', 'Dorfteich is an open-source wiki with real-time collaboration. This instance is being set up.', )}

{health.isPending && ( {t('home.api.checking', 'Checking API …')} )} {health.isSuccess && ( {t('home.api.ok', 'API reachable')} · {health.data.version} )} {health.isError && ( {t('home.api.error', 'API not reachable')} )} ); }