manifold/web/hooks/use-admin.ts

9 lines
257 B
TypeScript
Raw Normal View History

import { isAdmin } from '../../common/envs/constants'
import { usePrivateUser, useUser } from './use-user'
2022-02-09 18:58:33 +00:00
export const useAdmin = () => {
const user = useUser()
const privateUser = usePrivateUser(user?.id)
return isAdmin(privateUser?.email || '')
2022-02-09 18:58:33 +00:00
}