mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-23 02:44:27 -05:00
16 lines
412 B
TypeScript
16 lines
412 B
TypeScript
import { ADMIN_ID, STAFF_IDS } from "~/features/admin/admin-constants";
|
|
|
|
export function isAdmin(user?: { id: number }) {
|
|
return user?.id === ADMIN_ID;
|
|
}
|
|
|
|
export function isStaff(user?: { id: number }) {
|
|
if (!user) return false;
|
|
|
|
return STAFF_IDS.includes(user.id);
|
|
}
|
|
|
|
export function isSupporter(user?: { patronTier: number | null }) {
|
|
return typeof user?.patronTier === "number" && user.patronTier >= 2;
|
|
}
|