Files
gitlab-instance-0a899031_do…/app/checkout/page.tsx
2026-04-02 07:15:42 -05:00

44 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import Link from "next/link";
import { createCheckoutOrder } from "@/services/order.service";
export default async function CheckoutPage({
searchParams,
}: {
searchParams: Promise<{ plan?: string; slug?: string }>;
}) {
const { plan: rawPlan = "pro", slug = "unknown-app" } = await searchParams;
const plan = rawPlan === "free" || rawPlan === "pro" || rawPlan === "ultra" ? rawPlan : "pro";
const order = await createCheckoutOrder(plan, slug);
return (
<div className="space-y-6 py-8">
<section className="card-glass">
<p className="text-xs text-cyan-300"></p>
<h1 className="mt-1 text-3xl font-bold"></h1>
<p className="mt-2 text-sm text-slate-300">{order.plan.toUpperCase()} · {order.slug}</p>
</section>
<section className="grid gap-4 md:grid-cols-2">
<div className="card-glass space-y-2 text-sm">
<p>{order.id}</p>
<p>¥{order.amount}</p>
<p>PayJS</p>
<p className="text-slate-400"></p>
</div>
<div className="card-glass grid place-items-center">
<div className="grid h-44 w-44 place-items-center rounded-2xl border border-dashed border-cyan-300/40 text-xs text-slate-400">
</div>
</div>
</section>
<section className="card-glass flex flex-wrap gap-2">
<Link href={`/orders/${order.id}?status=pending&plan=${order.plan}&slug=${order.slug}`} className="cta-main">
</Link>
<Link href="/pricing" className="cta-sub"></Link>
</section>
</div>
);
}