Rework Dispatch Navigation
This commit is contained in:
@@ -12,6 +12,7 @@ import { WarningAlert } from "./ui/PageAlert";
|
||||
import { getServerSession } from "api/auth/[...nextauth]/auth";
|
||||
import { Error } from "./Error";
|
||||
import Image from "next/image";
|
||||
import { Radar } from "lucide-react";
|
||||
|
||||
export const VerticalNav = async () => {
|
||||
const session = await getServerSession();
|
||||
@@ -106,41 +107,64 @@ export const VerticalNav = async () => {
|
||||
);
|
||||
};
|
||||
|
||||
export const HorizontalNav = () => (
|
||||
<div className="navbar bg-base-200 shadow-md rounded-lg mb-4">
|
||||
<div className="flex items-center">
|
||||
<Link href="/" className="flex items-center">
|
||||
<Image
|
||||
src="/mail/var_logo.png"
|
||||
alt="VAR Logo"
|
||||
width={40}
|
||||
height={40}
|
||||
className="ml-2 mr-3"
|
||||
priority
|
||||
/>
|
||||
<h2 className="normal-case text-xl font-semibold">Virtual Air Rescue - HUB</h2>
|
||||
</Link>
|
||||
<WarningAlert />
|
||||
export const HorizontalNav = async () => {
|
||||
const session = await getServerSession();
|
||||
if (!session?.user) return <Error statusCode={401} title="Benutzer nicht authentifiziert!" />;
|
||||
|
||||
return (
|
||||
<div className="navbar bg-base-200 shadow-md rounded-lg mb-4">
|
||||
<div className="flex items-center">
|
||||
<Link href="/" className="flex items-center">
|
||||
<Image
|
||||
src="/mail/var_logo.png"
|
||||
alt="VAR Logo"
|
||||
width={40}
|
||||
height={40}
|
||||
className="ml-2 mr-3"
|
||||
priority
|
||||
/>
|
||||
<h2 className="normal-case text-xl font-semibold">Virtual Air Rescue - HUB</h2>
|
||||
</Link>
|
||||
<WarningAlert />
|
||||
</div>
|
||||
<div className="flex items-center ml-auto">
|
||||
<ul className="flex space-x-2 px-1 items-center">
|
||||
<li>
|
||||
<a
|
||||
href={process.env.NEXT_PUBLIC_DISPATCH_URL + "/tracker"}
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
>
|
||||
<button
|
||||
className="btn btn-sm btn-ghost tooltip tooltip-bottom"
|
||||
data-tip="Zum Tracker"
|
||||
>
|
||||
<Radar size={20} />
|
||||
</button>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href={process.env.NEXT_PUBLIC_DISPATCH_URL || "#!"}
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
>
|
||||
<button className="btn btn-sm btn-outline btn-primary">
|
||||
{session.user.permissions.includes("DISPO")
|
||||
? "Zur Leitstelle"
|
||||
: "Zum Operations Center"}
|
||||
</button>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<Link href="/logout">
|
||||
<button className="btn btn-sm btn-ghost">
|
||||
<ExitIcon /> Logout
|
||||
</button>
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center ml-auto">
|
||||
<ul className="flex space-x-2 px-1">
|
||||
<li>
|
||||
<a
|
||||
href={process.env.NEXT_PUBLIC_DISPATCH_URL || "#!"}
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
>
|
||||
<button className="btn btn-sm btn-outline btn-primary">Zur Leitstelle</button>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<Link href="/logout">
|
||||
<button className="btn btn-sm btn-ghost">
|
||||
<ExitIcon /> Logout
|
||||
</button>
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user