const TabsHelper = (router: NextRouter): { name: string; href: string }[] => {
 // get user role from local storage
 const userrole = localStorage.getItem("userrole");
 console.log(userrole);

 if (userrole === "admin") {
 return [
 { name: "All events", href: `/dashboard` },
 { name: "Verify users", href: `/verify` },
 { name: "Profile", href: `/profile` },
 ];
 } else if (userrole === "participant") {
 return [
 { name: "All events", href: `/dashboard` },
 { name: "Registered events", href: `/registered-events` },
 { name: "Profile", href: `/profile` },
 ];
 }
};

explain me this function in nextjs
user