Revert "Add missing admin action files and navigation links"

This reverts commit 41be6835bf.
This commit is contained in:
Simo committed 2026-07-11 20:37:56 +02:00
1 parent 4a1e1115b3
commit 4d515bc400
338 files changed
+5949 -28144

No files matched your search

+18 -4
View File
@@ -49,7 +49,11 @@ const ARTICLE_SELECT = {
position: true,
} as const;
export default async function ShopPage({ searchParams }: { searchParams: Promise<{ category?: string }> }) {
export default async function ShopPage({
searchParams,
}: {
searchParams: Promise<{ category?: string }>;
}) {
const t = await getTranslations("pages.shop");
const sp = await searchParams;
const rawCategory = (sp.category ?? "").trim();
@@ -100,14 +104,20 @@ export default async function ShopPage({ searchParams }: { searchParams: Promise
articles = [];
}
const activeCategory = categoryId ? categories.find((c) => String(c.id) === categoryId) : undefined;
const activeCategory = categoryId
? categories.find((c) => String(c.id) === categoryId)
: undefined;
return (
<main style={{ display: "grid", gap: "1.5rem" }}>
<ContentCard
icon="🛒"
title={t("title")}
subtitle={activeCategory ? t("browsingCategory", { category: activeCategory.name }) : t("subtitle")}
subtitle={
activeCategory
? t("browsingCategory", { category: activeCategory.name })
: t("subtitle")
}
>
{categories.length > 0 ? (
<div
@@ -136,7 +146,11 @@ export default async function ShopPage({ searchParams }: { searchParams: Promise
<ContentCard
icon="📦"
title={activeCategory ? activeCategory.name : t("allPackages")}
subtitle={articles.length > 0 ? t("packagesAvailable", { count: articles.length }) : undefined}
subtitle={
articles.length > 0
? t("packagesAvailable", { count: articles.length })
: undefined
}
padded={articles.length === 0}
>
{articles.length === 0 ? (
+9 -3
View File
@@ -71,7 +71,9 @@ export default function TopUpForm({
error?: string;
};
if (res.ok && data.ok) {
setSuccess(`Payment complete! ${(data.credits ?? 0).toLocaleString()} credits were added.`);
setSuccess(
`Payment complete! ${(data.credits ?? 0).toLocaleString()} credits were added.`,
);
} else {
setError(data.error ?? "We couldn't confirm your payment. Contact staff if charged.");
}
@@ -107,7 +109,10 @@ export default function TopUpForm({
}
return (
<form onSubmit={startCheckout} style={{ display: "flex", flexDirection: "column", gap: "0.75rem" }}>
<form
onSubmit={startCheckout}
style={{ display: "flex", flexDirection: "column", gap: "0.75rem" }}
>
<label htmlFor="amount" style={{ fontWeight: 700 }}>
Amount ({currency})
</label>
@@ -143,7 +148,8 @@ export default function TopUpForm({
</div>
<p className="muted" style={{ margin: 0 }}>
You&apos;ll receive <strong>{credits.toLocaleString()}</strong> credits.
You&apos;ll receive{" "}
<strong>{credits.toLocaleString()}</strong> credits.
</p>
<div>
+13 -4
View File
@@ -8,7 +8,11 @@ import { creditsPerUnit, isPayPalConfigured, PAYPAL_CURRENCY } from "@/lib/servi
export const dynamic = "force-dynamic";
export default async function TopUpPage({ searchParams }: { searchParams: Promise<{ status?: string }> }) {
export default async function TopUpPage({
searchParams,
}: {
searchParams: Promise<{ status?: string }>;
}) {
const session = await auth();
if (!session?.user?.id) redirect("/login");
@@ -33,7 +37,11 @@ export default async function TopUpPage({ searchParams }: { searchParams: Promis
return (
<main style={{ display: "grid", gap: "1.5rem" }}>
<ContentCard icon="💳" title={t("title")} subtitle={t("subtitle")} />
<ContentCard
icon="💳"
title={t("title")}
subtitle={t("subtitle")}
/>
{sp.status === "cancel" ? (
<div className="card" style={{ borderColor: "var(--color-danger)" }}>
@@ -47,8 +55,9 @@ export default async function TopUpPage({ searchParams }: { searchParams: Promis
<TopUpForm currency={PAYPAL_CURRENCY} creditsPerUnit={rate} />
) : (
<p className="muted" style={{ margin: 0 }}>
{t("notConfiguredPre")} <code>PAYPAL_CLIENT_ID</code> {t("notConfiguredAnd")}{" "}
<code>PAYPAL_SECRET</code> {t("notConfiguredOptional")} <code>PAYPAL_API</code>{" "}
{t("notConfiguredPre")} <code>PAYPAL_CLIENT_ID</code>{" "}
{t("notConfiguredAnd")} <code>PAYPAL_SECRET</code>{" "}
{t("notConfiguredOptional")} <code>PAYPAL_API</code>{" "}
{t("notConfiguredPost")}
</p>
)}