implemented

This commit is contained in:
counterweight 2025-12-20 23:06:05 +01:00
parent a31bd8246c
commit d3638e2e69
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
18 changed files with 1643 additions and 120 deletions

View file

@ -3,6 +3,9 @@
import { useRouter } from "next/navigation";
import { useAuth } from "../auth-context";
import { sharedStyles } from "../styles/shared";
import constants from "../../../shared/constants.json";
const { ADMIN, REGULAR } = constants.roles;
type PageId = "counter" | "sum" | "profile" | "invites" | "audit" | "admin-invites";
@ -33,8 +36,8 @@ const ADMIN_NAV_ITEMS: NavItem[] = [
export function Header({ currentPage }: HeaderProps) {
const { user, logout, hasRole } = useAuth();
const router = useRouter();
const isRegularUser = hasRole("regular");
const isAdminUser = hasRole("admin");
const isRegularUser = hasRole(REGULAR);
const isAdminUser = hasRole(ADMIN);
const handleLogout = async () => {
await logout();