manifold/web/hooks/use-admin.ts
2022-03-07 20:52:10 -08:00

9 lines
257 B
TypeScript

import { isAdmin } from '../../common/envs/constants'
import { usePrivateUser, useUser } from './use-user'
export const useAdmin = () => {
const user = useUser()
const privateUser = usePrivateUser(user?.id)
return isAdmin(privateUser?.email || '')
}