Replace the hand-rolled Tailwind/shadcn look with Sakani UI across the editorial area, the admin area and all signed-out pages. - AppShell (Sakani Sidebar + TopBar) for /redaktion and /admin, with a mobile drawer, theme toggle, sign-out, legal links and a "Was ist neu" button; PublicShell for login, registration, password, 2FA and errors. - Shared primitives (Button, Card, Input, PageHeader) now render Sakani; components/ui/sakani.tsx is the client boundary for Server Components (Sakani ships no "use client") and adds FormSelect (native form value) and DataTable (element cells from the server). - Legacy CSS variables map onto Sakani tokens; globals.css shrinks from ~2200 to ~700 lines. Geist replaces Inter. recharts/lucide-react dropped (charts via Sakani BarChart). - Release notes popup per area, shown once per version (localStorage) and reopenable from the sidebar; native <dialog> for focus trapping. - Fixes found while testing: TOTP field reused the typed password in clear text, modal dialogs sat top-left, invisible unchecked checkboxes in dark mode. - Parallel run: compose.parallel.yaml, AUTO_RULE_SYNC_DISABLED switch and docs/operations.md §8 (start, rollback, cutover). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
66 lines
2.8 KiB
TypeScript
66 lines
2.8 KiB
TypeScript
import { desc } from "drizzle-orm";
|
|
|
|
import Link from "next/link";
|
|
|
|
import { PageHeader } from "@/components/ui/page-header";
|
|
import { Badge, Card, EmptyState } from "@/components/ui/sakani";
|
|
import { db } from "@/db/client";
|
|
import { editorialAccounts } from "@/db/schema";
|
|
import { formatCents } from "@/modules/billing/format";
|
|
|
|
export default async function BillingOverviewPage() {
|
|
const editorials = await db
|
|
.select({
|
|
id: editorialAccounts.id,
|
|
name: editorialAccounts.name,
|
|
contactName: editorialAccounts.contactName,
|
|
loginEmail: editorialAccounts.loginEmail,
|
|
status: editorialAccounts.status,
|
|
currentPriceCents: editorialAccounts.currentPriceCents,
|
|
})
|
|
.from(editorialAccounts)
|
|
.orderBy(desc(editorialAccounts.createdAt));
|
|
|
|
return (
|
|
<section className="flex flex-col gap-6" aria-labelledby="billing-title">
|
|
<PageHeader
|
|
kicker="Abrechnungen"
|
|
title="Redaktionen"
|
|
titleId="billing-title"
|
|
description="Wählen Sie eine Redaktion, um deren abrechenbare Nutzungen für einen Monat oder ein Quartal auszuwählen."
|
|
/>
|
|
{editorials.length === 0 ? (
|
|
<EmptyState title="Noch keine Redaktionen registriert." description="Registrierte Redaktionen erscheinen hier zur Abrechnung." />
|
|
) : (
|
|
<ul className="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
|
|
{editorials.map((editorial) => (
|
|
<li key={editorial.id}>
|
|
<Link
|
|
className="block h-full rounded-[var(--radius-xl)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-border-focus)]"
|
|
href={`/admin/abrechnungen/${editorial.id}`}
|
|
>
|
|
<Card interactive className="h-full">
|
|
<div className="flex items-start justify-between gap-3">
|
|
<h2 className="text-base font-semibold">{editorial.name}</h2>
|
|
<Badge variant={editorial.status === "active" ? "success" : editorial.status === "pending_approval" ? "warning" : "danger"}>
|
|
{editorial.status === "active" ? "Aktiv" : editorial.status === "pending_approval" ? "Ausstehend" : "Gesperrt"}
|
|
</Badge>
|
|
</div>
|
|
<p className="text-sm text-[var(--color-fg-muted)]">
|
|
{editorial.contactName} · {editorial.loginEmail}
|
|
</p>
|
|
<p className="text-sm font-medium">
|
|
{editorial.currentPriceCents === null
|
|
? "Preis noch nicht festgelegt"
|
|
: `Netto ${formatCents(editorial.currentPriceCents)}`}
|
|
</p>
|
|
</Card>
|
|
</Link>
|
|
</li>
|
|
))}
|
|
</ul>
|
|
)}
|
|
</section>
|
|
);
|
|
}
|