51 lines
1.3 KiB
TypeScript
51 lines
1.3 KiB
TypeScript
import { redirect } from "next/navigation";
|
|
|
|
import { MediaLibraryManager } from "@/components/root/media-library-manager";
|
|
import { RootDashboardShell } from "@/components/root/root-dashboard-shell";
|
|
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
|
|
import { getAdminMediaAssets } from "@/lib/media";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
const copy = {
|
|
title: "Media Library",
|
|
subtitle: "Zentrale Dateien fuer Portfolio und spaetere Inhaltsbereiche.",
|
|
overview: "Uebersicht",
|
|
maintenance: "Wartungsmodus",
|
|
uiKit: "UI Kit",
|
|
media: "Media",
|
|
siteSettings: "Settings",
|
|
portfolio: "Portfolio",
|
|
logout: "Ausloggen",
|
|
backToSite: "Zur Website",
|
|
};
|
|
|
|
export default async function RootMediaPage() {
|
|
if (!(await isAdminAuthenticated())) {
|
|
redirect("/");
|
|
}
|
|
|
|
async function logoutAction() {
|
|
"use server";
|
|
|
|
await clearAdminSessionCookie();
|
|
redirect("/");
|
|
}
|
|
|
|
const mediaAssets = await getAdminMediaAssets();
|
|
|
|
return (
|
|
<RootDashboardShell
|
|
copy={copy}
|
|
active="media"
|
|
logoutAction={logoutAction}
|
|
headerTitle={copy.title}
|
|
headerDescription={copy.subtitle}
|
|
>
|
|
<div className="space-y-6">
|
|
<MediaLibraryManager mediaAssets={mediaAssets} />
|
|
</div>
|
|
</RootDashboardShell>
|
|
);
|
|
}
|