remove unused
This commit is contained in:
1 parent
1236b9191e
commit
a20fdb423a
7 files changed
+33
-249
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import type { RootState } from "@/Types/state";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
const useIsAdmin = (): boolean => {
|
||||
const { user } = useSelector((state: RootState) => state.auth);
|
||||
const isAdmin =
|
||||
(user?.role?.includes("admin") ?? false) ||
|
||||
(user?.role?.includes("superadmin") ?? false);
|
||||
return isAdmin;
|
||||
};
|
||||
|
||||
const useIsSuperAdmin = (): boolean => {
|
||||
const { user } = useSelector((state: RootState) => state.auth);
|
||||
const isSuperAdmin = user?.role?.includes("superadmin") ?? false;
|
||||
return isSuperAdmin;
|
||||
};
|
||||
|
||||
export { useIsAdmin, useIsSuperAdmin };
|
||||
Reference in new issue
Block a user