account system and syslogs
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user