Fix some bugs #34

This commit is contained in:
nocnico
2025-06-05 22:56:17 +02:00
parent 077bf85ad8
commit ea21c8d141
4 changed files with 118 additions and 12 deletions

View File

@@ -1,30 +1,41 @@
"use client";
import { ArrowLeftRight, Plane, Workflow } from "lucide-react";
import { ArrowLeftRight, Plane, Radar, Workflow } from "lucide-react";
import { useSession } from "next-auth/react";
import Link from "next/link";
import { usePathname } from "next/navigation";
export default function ModeSwitchDropdown() {
const path = usePathname();
const session = useSession();
return (
<div className="dropdown z-[9999]">
<div tabIndex={0} role="button" className="btn m-1">
<ArrowLeftRight /> {path.includes("pilot") && "Pilot"}
<ArrowLeftRight size={22} /> {path.includes("pilot") && "Pilot"}
{path.includes("dispatch") && "Leitstelle"}
</div>
<ul
tabIndex={0}
className="menu dropdown-content bg-base-100 rounded-box z-1 w-52 p-2 shadow-sm"
>
{session.data?.user.permissions?.includes("DISPO") && (
<li>
<Link href={"/dispatch"}>
<Workflow size={22} /> Leitstelle
</Link>
</li>
)}
{session.data?.user.permissions?.includes("PILOT") && (
<li>
<Link href={"/pilot"}>
<Plane size={22} /> Pilot
</Link>
</li>
)}
<li>
<Link href={"/dispatch"}>
<Workflow /> Leitstelle
</Link>
</li>
<li>
<Link href={"/pilot"}>
<Plane /> Pilot
<Link href={"/tracker"}>
<Radar size={22} /> Tracker
</Link>
</li>
</ul>