The first commit, the core and all files is adding to repo

This commit is contained in:
2026-10-04 14:20:13 +05:00
commit 53d7b263c4
94 changed files with 10668 additions and 0 deletions

55
app/dashboard/page.tsx Normal file
View File

@@ -0,0 +1,55 @@
import { Header, Footer } from "@/components/Shell";
import { SignIn } from "@/components/SignIn";
import { Dashboard } from "@/components/Dashboard";
import { admin, user, required } from "@/lib/supabase";
import Link from "next/link";
export const dynamic = "force-dynamic";
export default async function DashboardPage() {
const account = await user();
const history = account
? required(
await admin()
.from("game_sessions")
.select("id,difficulty,created_at,current_round")
.eq("owner_id", account.id)
.order("created_at", { ascending: false })
.limit(20),
)
: [];
return (
<>
<Header />
<main className="section page-content">
{account ? (
<>
<span className="eyebrow">THE CARTOGRAPHER’S DESK</span>
<h1>My expedition.</h1>
<Dashboard />
{history.length > 0 && (
<section className="token-box">
<h2>Recent journeys</h2>
{history.map((s) => (
<div className="draft-row" key={s.id}>
<span>
{new Date(s.created_at).toLocaleDateString("en-GB")} ·{" "}
{s.difficulty} · {s.current_round}/5 rounds
</span>
<Link
className="button"
href={`/${s.current_round >= 5 ? "results" : "play"}/${s.id}`}
>
Open →
</Link>
</div>
))}
</section>
)}
</>
) : (
<SignIn />
)}
</main>
<Footer />
</>
);
}