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