feat: add billing period selection

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Leon TonhäuserandClaude committed 2026-08-10 17:31:42 +02:00
1 parent ba673ad732
commit d37affc80f
15 files changed
+1625

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
import { desc } from "drizzle-orm";
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="content-section" aria-labelledby="billing-title">
<p className="eyebrow">Abrechnungen</p>
<h1 id="billing-title">Redaktionen</h1>
<p className="form-note">
Wählen Sie eine Redaktion, um deren abrechenbare Nutzungen für einen Monat oder ein Quartal
auszuwählen.
</p>
{editorials.length === 0 ? (
<p>Noch keine Redaktionen registriert.</p>
) : (
<ul className="billing-editorial-list">
{editorials.map((editorial) => (
<li key={editorial.id}>
<a href={`/admin/abrechnungen/${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>
))}
</ul>
)}
</section>
);
}