Sometime we have a list of routes for specific user roles, such as admin, user, editor, etc. In this case, we want to show the role based routes permission then we can use RoleBasedGuard component from app.
RoleBasedGuard.jsx
"use client";
import { PropsWithChildren } from "react";
import useAuth from "hooks/useAuth";
import ErrorView from "page-sections/permission/ErrorView";