import { getServerSession } from "next-auth"; import { authOptions } from "@/app/api/auth/[...nextauth]/route"; import { FormLayoutClient } from "./client"; import LoginDialog from "@/components/login-dialog"; import { Metadata } from "next"; import { ThemeToggle } from "@/components/theme-toggle"; import { getDiscordMemberProfile } from "@/app/actions/discord"; import Link from 'next/link'; const siteUrl = process.env.BASE_URL; export const metadata: Metadata = { title: "กรอกแบบฟอร์ม", openGraph: { type: "website", locale: "th_TH", url: siteUrl, siteName: "Form", title: "กรอกแบบฟอร์ม", description: "Custom form ของเว็บไซด์", images: [ { url: "/avatar.webp", width: 512, height: 512, alt: "Erika! avatar", }, ], }, } export default async function FormLayout({ children, }: { children: React.ReactNode; }) { const session = await getServerSession(authOptions); const discordId = (session?.user as any)?.discordId; let profile = null; if (discordId) { profile = await getDiscordMemberProfile(discordId); } return (