manifold/web/hooks/use-admin.ts
2022-08-22 10:48:21 -07:00

12 lines
290 B
TypeScript

import { isAdmin } from 'common/envs/constants'
import { usePrivateUser } from './use-user'
export const useAdmin = () => {
const privateUser = usePrivateUser()
return isAdmin(privateUser?.email || '')
}
export const useDev = () => {
return process.env.NODE_ENV === 'development'
}