This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
Files
scoresaber-reloadedv3/projects/website/src/app/(pages)/page.tsx
Liam 6c81316364
All checks were successful
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m23s
auto reload site stats
2024-10-27 19:30:58 +00:00

34 lines
1.2 KiB
TypeScript

import { Button } from "@/components/ui/button";
import Link from "next/link";
import { AppStatistics } from "@ssr/common/types/backend/app-statistics";
import { kyFetch } from "@ssr/common/utils/utils";
import { Config } from "@ssr/common/config";
import { AppStats } from "@/components/app-statistics";
export const dynamic = "force-dynamic"; // Always generate the page on load
export default async function HomePage() {
const statistics = await kyFetch<AppStatistics>(Config.apiUrl + "/statistics");
return (
<main className="flex flex-col items-center w-full gap-6 text-center">
<div className="flex items-center flex-col">
<p className="font-semibold text-2xl">ScoreSaber Reloaded</p>
<p className="text-center">Welcome to the ScoreSaber Reloaded website.</p>
</div>
<div className="flex items-center flex-col">
<p>ScoreSaber Reloaded is a website that allows you to track your ScoreSaber data over time.</p>
</div>
{statistics && <AppStats initialStatistics={statistics} />}
<div className="flex gap-2 flex-wrap">
<Link href="/search">
<Button className="w-fit">Get started</Button>
</Link>
</div>
</main>
);
}