import { Providers } from "@/app/providers"; import { Layout } from "@/components/layout"; import { type Section } from "@/components/section-provider"; import "@/styles/tailwind.css"; import glob from "fast-glob"; import { type Metadata } from "next"; import { Jost } from "next/font/google"; import Script from "next/script"; export const metadata: Metadata = { title: { template: "%s - Formbricks Docs", default: "Formbricks Documentation", }, }; const jost = Jost({ subsets: ["latin"] }); async function RootLayout({ children }: { children: React.ReactNode }) { const pages = await glob("**/*.mdx", { cwd: "src/app" }); const allSectionsEntries: [string, Section[]][] = (await Promise.all( pages.map(async (filename) => [ `/${filename.replace(/(?:^|\/)page\.mdx$/, "")}`, (await import(`./${filename}`) as { sections: Section[] }).sections, ]) )); const allSections = Object.fromEntries(allSectionsEntries); return ( {process.env.NEXT_PUBLIC_LAYER_API_KEY ?