Moved Dispatch NAvbar component, to remove code dupl.; Fixed timezone bug in hub
This commit is contained in:
@@ -1,18 +1,24 @@
|
||||
"use client";
|
||||
|
||||
import { cn } from "@repo/shared-components";
|
||||
import { ArrowLeftRight, Plane, Radar, Workflow } from "lucide-react";
|
||||
import { ArrowLeftRight, ExternalLinkIcon, 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({ className }: { className?: string }) {
|
||||
export default function ModeSwitchDropdown({
|
||||
className,
|
||||
btnClassName,
|
||||
}: {
|
||||
className?: string;
|
||||
btnClassName?: string;
|
||||
}) {
|
||||
const path = usePathname();
|
||||
const session = useSession();
|
||||
|
||||
return (
|
||||
<div className={cn("dropdown z-999999", className)}>
|
||||
<div tabIndex={0} role="button" className="btn m-1">
|
||||
<div tabIndex={0} role="button" className={cn("btn", btnClassName)}>
|
||||
<ArrowLeftRight size={22} /> {path.includes("pilot") && "Pilot"}
|
||||
{path.includes("dispatch") && "Leitstelle"}
|
||||
</div>
|
||||
@@ -39,6 +45,15 @@ export default function ModeSwitchDropdown({ className }: { className?: string }
|
||||
<Radar size={22} /> Tracker
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link
|
||||
href={process.env.NEXT_PUBLIC_HUB_URL || "#!"}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<ExternalLinkIcon size={22} /> HUB
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user