Files
formbricks/apps/formbricks-com/app/docs/layout.tsx

34 lines
990 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import glob from "fast-glob";
import { Providers } from "@/app/providers";
import { Layout } from "@/components/docs/Layout";
import { type Section } from "@/components/docs/SectionProvider";
import { type Metadata } from "next";
export const metadata: Metadata = {
title: {
template: "Formbricks Open Source Experience Management",
default: "Formbricks Docs",
},
};
export default async function RootLayout({ children }: { children: React.ReactNode }) {
let pages = await glob("**/*.mdx", { cwd: "app/docs" });
let allSectionsEntries = (await Promise.all(
pages.map(async (filename) => [
"/docs/" + filename.replace(/(^|\/)page\.mdx$/, ""),
(await import(`./${filename}`)).sections,
])
)) as Array<[string, Array<Section>]>;
let allSections = Object.fromEntries(allSectionsEntries);
return (
<Providers>
<div className="w-full">
<Layout allSections={allSections}>{children}</Layout>
</div>
</Providers>
);
}