import type { Metadata } from "next"; import { headers } from "next/headers"; import "./globals.css"; export async function generateMetadata(): Promise { const headerStore = await headers(); const host = headerStore.get("x-forwarded-host") ?? headerStore.get("host") ?? "localhost:3000"; const protocol = headerStore.get("x-forwarded-proto") ?? (host.startsWith("localhost") ? "http" : "https"); const origin = `${protocol}://${host}`; return { title: "智能称重终端|沃尔核材", description: "面向生产现场的废料智能称重、稳定采样与数据追溯应用。", icons: { icon: "/favicon.svg", shortcut: "/favicon.svg", }, openGraph: { title: "智能称重终端", description: "稳定采样 · 精准记录 · 数据可追溯", images: [{ url: `${origin}/og.png`, width: 1536, height: 864, alt: "智能称重终端" }], }, twitter: { card: "summary_large_image", title: "智能称重终端", description: "稳定采样 · 精准记录 · 数据可追溯", images: [`${origin}/og.png`], }, }; } export default function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { return ( {children} ); }