feat: redesign dashboard, add lightbox bulk download, and standardize ui

This commit is contained in:
Leon Tonhäuser committed 2026-08-11 11:18:39 +02:00
1 parent 8728308fc6
commit 4a9da65901
13 files changed
+923 -104

No files matched your search

+72 -30
View File
@@ -1,7 +1,9 @@
import { desc } from "drizzle-orm";
import Link from "next/link";
import { db } from "@/db/client";
import { editorialAccounts } from "@/db/schema";
import { PageHeader } from "@/components/ui/page-header";
import { Card, CardContent } from "@/components/ui/card";
export default async function EditorialsPage() {
const editorials = await db
@@ -22,48 +24,88 @@ export default async function EditorialsPage() {
const archivedEditorials = editorials.filter((e) => e.archivedAt);
return (
<section className="content-section" aria-labelledby="editorials-title">
<p className="eyebrow">Kontoverwaltung</p>
<h1 id="editorials-title">Redaktionen</h1>
<div className="space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500 max-w-7xl">
<PageHeader
kicker="Kontoverwaltung"
title="Redaktionen"
description="Verwalte hier alle registrierten und archivierten Redaktionszugänge."
/>
{activeEditorials.length === 0 ? (
<p>Noch keine aktiven Redaktionen registriert.</p>
<p className="text-muted-foreground">Noch keine aktiven Redaktionen registriert.</p>
) : (
<ul>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
{activeEditorials.map((editorial) => (
<li key={editorial.id}>
<a href={`/admin/redaktionen/${editorial.id}`}>{editorial.name}</a>
<p>
{editorial.contactName} · {editorial.loginEmail} · Status: {editorial.status}
{editorial.currentPriceCents === null
? " · Preis noch nicht festgelegt"
: ` · Netto ${formatCents(editorial.currentPriceCents)}`}
</p>
</li>
<Link key={editorial.id} href={`/admin/redaktionen/${editorial.id}`} className="block group">
<Card className="h-full transition-all duration-300 hover:shadow-md hover:border-primary-500/50 hover:-translate-y-1">
<CardContent className="p-6 flex flex-col h-full justify-between">
<div>
<h3 className="text-xl font-semibold mb-2 group-hover:text-primary-600 dark:group-hover:text-primary-400 transition-colors">
{editorial.name}
</h3>
<div className="space-y-1 text-sm text-muted-foreground">
<p className="flex items-center gap-2">
<span className="font-medium text-foreground">Kontakt:</span> {editorial.contactName}
</p>
<p className="flex items-center gap-2">
<span className="font-medium text-foreground">E-Mail:</span> {editorial.loginEmail}
</p>
<p className="flex items-center gap-2">
<span className="font-medium text-foreground">Status:</span>
<span className={`px-2 py-0.5 rounded-full text-xs font-medium ${
editorial.status === "active" ? "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400" :
editorial.status === "pending_approval" ? "bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400" :
"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400"
}`}>
{editorial.status === "active" ? "Aktiv" : editorial.status === "pending_approval" ? "Ausstehend" : "Gesperrt"}
</span>
</p>
</div>
</div>
<div className="mt-6 pt-4 border-t border-border">
<p className="text-sm font-medium">
{editorial.currentPriceCents === null
? "Preis noch nicht festgelegt"
: `Netto ${formatCents(editorial.currentPriceCents)}`}
</p>
</div>
</CardContent>
</Card>
</Link>
))}
</ul>
</div>
)}
{archivedEditorials.length > 0 && (
<details className="mt-8">
<summary className="cursor-pointer text-sm font-semibold text-gray-500 uppercase tracking-widest">
<details className="mt-12 group">
<summary className="cursor-pointer flex items-center gap-2 text-sm font-semibold uppercase tracking-widest text-muted-foreground hover:text-foreground transition-colors mb-6 list-none">
<span className="bg-muted p-1 rounded-sm group-open:rotate-90 transition-transform">
▶
</span>
Archivierte Redaktionen ({archivedEditorials.length})
</summary>
<ul className="mt-4 opacity-75">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 opacity-75 grayscale hover:grayscale-0 transition-all duration-500">
{archivedEditorials.map((editorial) => (
<li key={editorial.id}>
<a href={`/admin/redaktionen/${editorial.id}`} className="text-gray-600">
{editorial.name}
</a>
<p className="text-gray-500">
{editorial.contactName} · {editorial.loginEmail} · Archiviert am:{" "}
{editorial.archivedAt?.toLocaleDateString("de-DE")}
</p>
</li>
<Link key={editorial.id} href={`/admin/redaktionen/${editorial.id}`} className="block group">
<Card className="h-full transition-all duration-300 hover:shadow-sm">
<CardContent className="p-6">
<h3 className="text-lg font-semibold mb-2 text-muted-foreground group-hover:text-foreground transition-colors">
{editorial.name}
</h3>
<div className="space-y-1 text-sm text-muted-foreground">
<p>{editorial.contactName} · {editorial.loginEmail}</p>
<p className="pt-2">
Archiviert am: {editorial.archivedAt?.toLocaleDateString("de-DE")}
</p>
</div>
</CardContent>
</Card>
</Link>
))}
</ul>
</div>
</details>
)}
</section>
</div>
);
}