Admin-Panel hinzugefügt
This commit is contained in:
@@ -3,8 +3,12 @@ import Link from "next/link";
|
|||||||
import { prisma } from "@repo/db";
|
import { prisma } from "@repo/db";
|
||||||
import { ChangelogWrapper } from "_components/navbar/ChangelogWrapper";
|
import { ChangelogWrapper } from "_components/navbar/ChangelogWrapper";
|
||||||
import ModeSwitchDropdown from "_components/navbar/ModeSwitchDropdown";
|
import ModeSwitchDropdown from "_components/navbar/ModeSwitchDropdown";
|
||||||
|
import { useSession } from "next-auth/react";
|
||||||
|
import { getServerSession } from "api/auth/[...nextauth]/auth";
|
||||||
|
import AdminPanel from "_components/navbar/AdminPanel";
|
||||||
|
|
||||||
export default async function Navbar({ children }: { children: React.ReactNode }) {
|
export default async function Navbar({ children }: { children: React.ReactNode }) {
|
||||||
|
const session = await getServerSession();
|
||||||
const latestChangelog = await prisma.changelog.findFirst({
|
const latestChangelog = await prisma.changelog.findFirst({
|
||||||
orderBy: {
|
orderBy: {
|
||||||
createdAt: "desc",
|
createdAt: "desc",
|
||||||
@@ -17,6 +21,7 @@ export default async function Navbar({ children }: { children: React.ReactNode }
|
|||||||
<p className="text-xl font-semibold normal-case">VAR Operations Center</p>
|
<p className="text-xl font-semibold normal-case">VAR Operations Center</p>
|
||||||
<ChangelogWrapper latestChangelog={latestChangelog} />
|
<ChangelogWrapper latestChangelog={latestChangelog} />
|
||||||
</div>
|
</div>
|
||||||
|
{session?.user.permissions.includes("ADMIN_KICK") && <AdminPanel />}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import Navbar from "(app)/_components/Navbar";
|
|||||||
import { Audio } from "_components/Audio/Audio";
|
import { Audio } from "_components/Audio/Audio";
|
||||||
import { Connection } from "./_components/navbar/Connection";
|
import { Connection } from "./_components/navbar/Connection";
|
||||||
import { Settings } from "./_components/navbar/Settings";
|
import { Settings } from "./_components/navbar/Settings";
|
||||||
|
import AdminPanel from "_components/navbar/AdminPanel";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "VAR: Disponent",
|
title: "VAR: Disponent",
|
||||||
|
|||||||
Reference in New Issue
Block a user