Files
kandev/apps/web/hooks/domains/auth/use-is-admin.ts
T
2026-08-25 15:05:14 +01:00

12 lines
405 B
TypeScript

"use client";
import { useAppStore } from "@/components/state-provider";
import { isAdminIdentity } from "@/lib/auth/is-admin";
/** Whether the current caller may use admin-only, install-wide controls. */
export function useIsAdmin(): boolean {
const mode = useAppStore((state) => state.auth.mode);
const role = useAppStore((state) => state.auth.user?.role);
return isAdminIdentity(mode, role);
}