import { notFound } from "next/navigation"; import type { CSSProperties } from "react"; import { db } from "@/lib/db"; import { THEME_TOKENS } from "@/lib/constants"; import { ProfileHeader } from "@/components/public/profile-header"; import { PaymentMethodCard } from "@/components/public/payment-method-card"; import { SocialLinksList } from "@/components/public/social-links-list"; export const revalidate = 60; type PublicProfilePageProps = { params: Promise<{ username: string; }>; }; export default async function PublicProfilePage({ params }: PublicProfilePageProps) { const { username } = await params; const normalizedUsername = username?.trim().toLowerCase(); if (!normalizedUsername) { notFound(); } const profile = await db.profile.findUnique({ where: { username: normalizedUsername }, include: { paymentMethods: { select: { id: true, type: true, label: true, value: true, network: true, description: true, isVisible: true }, where: { isVisible: true }, orderBy: [{ sortOrder: "asc" }, { createdAt: "asc" }] }, socialLinks: { select: { id: true, label: true, url: true }, where: { isVisible: true }, orderBy: [{ sortOrder: "asc" }, { createdAt: "asc" }] } } }); if (!profile || !profile.isPublic) { notFound(); } const tokens = THEME_TOKENS[profile.themeId] ?? THEME_TOKENS["terminal-dark"]; return (

Payment Methods

{profile.paymentMethods.length === 0 ? (

No payment methods published yet.

) : (
{profile.paymentMethods.map((method) => ( ))}
)}
); }