account system and syslogs

This commit is contained in:
2026-07-26 18:31:43 +00:00
parent 540f6e0af1
commit 6f7af751e1
37 changed files with 2475 additions and 258 deletions
+10 -5
View File
@@ -1,10 +1,11 @@
"use client";
type Props = {
readOnly?: boolean;
username?: string;
isAdmin?: boolean;
};
export function AdminHeader({ readOnly = false }: Props) {
export function AdminHeader({ username, isAdmin = false }: Props) {
async function logout() {
await fetch("/api/auth/logout", { method: "POST" });
window.location.href = "/login";
@@ -16,9 +17,13 @@ export function AdminHeader({ readOnly = false }: Props) {
<h1 className="text-lg font-semibold tracking-tight text-zinc-900 dark:text-zinc-50">
Kick Kings Admin Dashboard
</h1>
{readOnly ? (
<p className="mt-0.5 text-xs font-medium uppercase tracking-wide text-amber-700 dark:text-amber-300">
Read-only access
{username ? (
<p className="mt-0.5 text-xs text-zinc-500 dark:text-zinc-400">
Signed in as{" "}
<span className="font-medium text-zinc-700 dark:text-zinc-300">
{username}
</span>
{isAdmin ? " · admin" : null}
</p>
) : null}
</div>