manifold/web/hooks/use-admin.ts

12 lines
290 B
TypeScript
Raw Normal View History

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