Reapply "Add missing admin action files and navigation links"

This reverts commit 4d515bc400.
This commit is contained in:
Simo committed 2026-07-11 20:52:56 +02:00
1 parent 96ed768f14
commit 5b4228261a
338 files changed
+28143 -5948

No files matched your search

+14 -14
View File
@@ -12,13 +12,7 @@ const PER_PAGE = 25;
type Txn = Awaited<ReturnType<typeof prisma.websitePaypalTransactions.findMany>>[number];
const PAID_STATUS = new Set(["completed", "paid", "success", "approved"]);
const FAILED_STATUS = new Set([
"failed",
"denied",
"refunded",
"cancelled",
"canceled",
]);
const FAILED_STATUS = new Set(["failed", "denied", "refunded", "cancelled", "canceled"]);
function statusState(status: string | null | undefined): "ok" | "danger" | undefined {
if (!status) return undefined;
@@ -112,7 +106,9 @@ export default async function AdminTransactions({
</div>
<section className="mt-6">
<h2 className="admin-section-title">{t("title")} ({total})</h2>
<h2 className="admin-section-title">
{t("title")} ({total})
</h2>
{transactions.length === 0 ? (
<div className="admin-empty">{t("noTransactions")}</div>
) : (
@@ -134,11 +130,11 @@ export default async function AdminTransactions({
const state = statusState(x.status);
return (
<tr key={String(x.id)}>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">{String(x.id)}</td>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">
{String(x.id)}
</td>
<td>
<Link href={`/admin/users/${x.userId}`}>
{names.get(x.userId) ?? `#${x.userId}`}
</Link>
<Link href={`/admin/users/${x.userId}`}>{names.get(x.userId) ?? `#${x.userId}`}</Link>
</td>
<td>{formatAmount(x.amount, x.currency)}</td>
<td>{x.description ?? "—"}</td>
@@ -153,8 +149,12 @@ export default async function AdminTransactions({
<span className="text-sm text-gray-500 dark:text-gray-400">—</span>
)}
</td>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">{x.transactionId}</td>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">{fromDate(x.createdAt)}</td>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">
{x.transactionId}
</td>
<td className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">
{fromDate(x.createdAt)}
</td>
</tr>
);
})}