fix: link album assignment and narrow errors

This commit is contained in:
Leon Tonhäuser committed 2026-08-09 22:06:34 +02:00
1 parent 4af86f6eb9
commit f6e6018cc1
5 files changed
+123 -42

No files matched your search

+56
View File
@@ -0,0 +1,56 @@
import Link from "next/link";
export type EditorialDetail = {
id: string;
name: string;
contactName: string;
loginEmail: string;
status: string;
emailVerifiedAt: Date | null;
currentPriceCents: number | null;
};
export function EditorialDetailContent({
editorial,
hasActiveGrant,
}: Readonly<{ editorial: EditorialDetail; hasActiveGrant: boolean }>) {
return (
<section className="content-section" aria-labelledby="editorial-title">
<p className="eyebrow">Redaktion</p>
<h1 id="editorial-title">{editorial.name}</h1>
<dl>
<dt>Ansprechperson</dt>
<dd>{editorial.contactName}</dd>
<dt>Anmelde-E-Mail</dt>
<dd>{editorial.loginEmail}</dd>
<dt>Status</dt>
<dd>{editorial.status}</dd>
<dt>E-Mail bestätigt</dt>
<dd>{editorial.emailVerifiedAt ? "Ja" : "Nein"}</dd>
<dt>Individueller Nettopreis</dt>
<dd>
{editorial.currentPriceCents === null
? "Noch nicht festgelegt"
: formatCents(editorial.currentPriceCents)}
</dd>
</dl>
<section aria-labelledby="approval-title">
<h2 id="approval-title">Freigabe</h2>
<button type="button" disabled aria-describedby="approval-help">
Redaktion freigeben
</button>
<p id="approval-help">
{hasActiveGrant
? "Mindestens ein Albumrecht ist zugewiesen. Die Freigabe bleibt bis zur weiteren Verwaltungsoberfläche deaktiviert."
: "Eine Freigabe ist erst möglich, wenn mindestens ein aktives Albumrecht zugewiesen wurde."}
</p>
<Link href={`/admin/redaktionen/${editorial.id}/alben`}>Albumrechte verwalten</Link>
</section>
</section>
);
}
function formatCents(cents: number): string {
return new Intl.NumberFormat("de-DE", { style: "currency", currency: "EUR" }).format(cents / 100);
}