mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-14 00:59:26 -05:00
22 lines
533 B
TypeScript
22 lines
533 B
TypeScript
import { ADMIN_ID, DEV_IDS, 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 isDev(user?: { id: number }) {
|
|
if (!user) return false;
|
|
|
|
return DEV_IDS.includes(user.id);
|
|
}
|
|
|
|
export function isSupporter(user?: { patronTier: number | null }) {
|
|
return typeof user?.patronTier === "number" && user.patronTier >= 2;
|
|
}
|