import type { Metadata } from "next";
import SiteFrame from "@/components/SiteFrame";
import "./globals.css";
import { defaultContent } from "@/lib/content/defaults";
import { getContent } from "@/lib/content/service";
import { createContentMetadata } from "./seo";

export async function generateMetadata(): Promise<Metadata> {
  const settings = await getContent("settings");
  return createContentMetadata(settings.seo, defaultContent.settings.seo);
}

export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
  return (
    <html lang="de">
      <body>
        <SiteFrame>{children}</SiteFrame>
      </body>
    </html>
  );
}
