aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/routes/admin.dashboard.tsx
blob: 8a0c9a8da1976545d1c666439d7ff3e0403be1c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node";
import { Form, Link } from "@remix-run/react";
import { ensureAdminUserLoggedIn } from "../.server/auth";

export const meta: MetaFunction = () => [
	{ title: "[Admin] Dashboard | iOSDC Japan 2024 Albatross.swift" },
];

export async function loader({ request }: LoaderFunctionArgs) {
	await ensureAdminUserLoggedIn(request);
	return null;
}

export default function AdminDashboard() {
	return (
		<div>
			<h1>[Admin] Dashboard</h1>
			<p>
				<Link to="/admin/users">Users</Link>
			</p>
			<p>
				<Link to="/admin/games">Games</Link>
			</p>
			<Form method="post" action="/logout">
				<button type="submit">Logout</button>
			</Form>
		</div>
	);
}