import glob from "fast-glob"; import type { Metadata } from "next"; import { Layout } from "../components/Layout"; import type { Section } from "../components/SectionProvider"; import { Providers } from "./providers"; import "@/styles/tailwind.css"; import type { ReactNode } from "react"; export const metadata: Metadata = { title: { template: "%s - Lysand API Reference", default: "Lysand API Reference", }, }; export default async function RootLayout({ children, }: { children: ReactNode; }) { const pages = await glob("**/*.mdx", { cwd: "app" }); const allSectionsEntries = (await Promise.all( pages.map(async (filename) => [ `/${filename.replace(/(^|\/)page\.mdx$/, "")}`, (await import(`./${filename}`)).sections, ]), )) as [string, Section[]][]; const allSections = Object.fromEntries(allSectionsEntries); return (
{children}
); }