import Link from "next/link"; import { prisma } from "@/lib/prisma"; export const dynamic = "force-dynamic"; export default async function AdminShop() { let packages: Awaited> = []; try { packages = await prisma.websiteShopArticles.findMany({ orderBy: [{ position: "asc" }, { name: "asc" }], take: 500, }); } catch { packages = []; } let orders: Awaited> = []; try { orders = await prisma.websitePaypalTransactions.findMany({ orderBy: { createdAt: "desc" }, take: 50, }); } catch { orders = []; } return (

Shop

+ New package

Website store packages (website_shop_articles). costs is the price shown in the store; credits/duckets/diamonds/badges are what the buyer receives.

{packages.map((p) => ( ))}
# Name Costs Credits Duckets Diamonds Rank Position
{String(p.id)} {p.name} {p.costs} {p.credits ?? ""} {p.duckets ?? ""} {p.diamonds ?? ""} {p.giveRank ?? ""} {p.position}
{packages.length === 0 ?

No shop packages yet.

: null}

Recent orders

Read-only PayPal transaction log (website_paypal_transactions).

{orders.map((o) => ( ))}
Transaction User Description Amount Status Date
{o.transactionId} {o.userId} {o.description ?? ""} {o.amount} {o.currency} {o.status ?? ""} {o.createdAt ? o.createdAt.toISOString().slice(0, 10) : ""}
{orders.length === 0 ?

No orders recorded.

: null}
); }