Initial commit

This commit is contained in:
2026-03-27 19:35:14 +01:00
commit 38581b88a4
68 changed files with 12137 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
import { PaymentMethodsForm } from "@/components/dashboard/payment-methods-form";
import { PaymentMethodsList } from "@/components/dashboard/payment-methods-list";
import { db } from "@/lib/db";
import { requireCurrentUser } from "@/lib/session";
export default async function DashboardPaymentMethodsPage() {
const user = await requireCurrentUser();
const profile = await db.profile.findUnique({
where: { userId: user.id },
include: {
paymentMethods: {
select: {
id: true,
type: true,
label: true,
value: true,
network: true,
description: true,
sortOrder: true,
isVisible: true
},
orderBy: [{ sortOrder: "asc" }, { createdAt: "asc" }]
}
}
});
if (!profile) {
return <p className="text-sm text-red-300">Profile not found.</p>;
}
return (
<section className="space-y-6">
<header className="space-y-2">
<h1 className="text-2xl font-semibold">Payment Methods</h1>
<p className="text-sm text-muted">
Add, edit, reorder, and toggle payment methods. Validation is format-based only and not authoritative.
</p>
</header>
<PaymentMethodsForm />
<PaymentMethodsList methods={profile.paymentMethods} />
</section>
);
}