import { prisma } from "@/lib/db"; import { getConsoleContext } from "@/lib/console"; import { roleAtLeast } from "@/lib/auth/roles"; import { EmptyState, PageTitle } from "@/components/ui"; import { PagePicker } from "@/components/PagePicker"; import { ProfileForm } from "@/components/ProfileForm"; const TITLE = "โปรไฟล์ร้าน"; export default async function ProfilePage() { const ctx = await getConsoleContext(); const page = ctx.selected; if (!page) { return ( <>
({ id, name, pictureUrl }))} />
); } const profile = await prisma.pageProfile.findUnique({ where: { pageId: page.id }, select: { business: true, audience: true, tone: true, visualStyle: true, avoid: true, cta: true, website: true, updatedAt: true }, }); return ( <> ); }