/* * Copyright (C) 2024 Aleksander WilczyƄski (aleks@alekswilc.dev) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * See LICENSE for more. */ import { useTranslation, Trans } from "react-i18next"; import { Link } from "react-router-dom"; import { TStatsResponse } from "../types/stats.ts"; import { WarningAlert } from "../components/mini/alerts/Warning.tsx"; import { CardDataStats } from "../components/mini/util/CardDataStats.tsx"; import { fetcher } from "../util/fetcher.ts"; import useSWR from 'swr'; import { LoadError } from "../components/mini/loaders/ContentLoader.tsx"; export const Home = () => { const { t } = useTranslation(); const { data, error } = useSWR("/stats/", fetcher, { refreshInterval: 10_000, errorRetryCount: 5 }); return ( <>
{ error && }

{ t("home.title") }

{ t("home.description") }

{ t("home.buttons.project") } { t("home.buttons.forum") }

, } } />

, simrailelite: , } } />

{ t("home.footer.license") } GNU AGPL V3

{ t("home.footer.powered") } TailAdmin

{ data?.data?.git?.version && { data?.data?.git?.version } }{ data?.data?.git?.version && data?.data?.git?.commit && " | " }{ data?.data?.git?.commit && { data?.data?.git?.commit } }

); };