import { useAuth } from "@/providers/AuthProvider";
import { isSiteAdmin } from "@/util/PermissionUtil";
import { BsFillPersonFill } from "react-icons/bs";
import { NavLink } from "react-router";
export default function ProtectedNavLinks(){
const { jwt, accountPermissions } = useAuth();
if(!jwt){
return <>>;
}
const protectedLinks = [
{
name: "Game",
path: "/game"
},
{
name: "Raid Group",
path: "/raidGroup"
}
];
if(isSiteAdmin(accountPermissions)){
protectedLinks.push({
name: "Admin",
path: "/admin"
});
}
protectedLinks.push({
name: "Logout",
path: "/logout"
});
return (
<>
{
protectedLinks.map((link) => (
{link.name}
))
}
{
jwt &&
}
>
);
}