UNPKG

fumadocs-ui

Version:

The Radix UI version of Fumadocs UI

38 lines (35 loc) 1.72 kB
'use client'; import { LayoutContext } from "./layouts/docs/client.js"; import { PageBreadcrumb, PageLastUpdate } from "./layouts/docs/page/client.js"; import { DocsBody, DocsDescription, DocsTitle, EditOnGitHub, page_exports } from "./layouts/docs/page/index.js"; import { page_exports as page_exports$1 } from "./layouts/notebook/page/index.js"; import { cn } from "@fumadocs/ui/cn"; import { jsx, jsxs } from "react/jsx-runtime"; import { use } from "react"; //#region src/page.tsx /** * For separate MDX page */ function withArticle(props) { return /* @__PURE__ */ jsx("main", { ...props, className: cn("w-full max-w-[1400px] mx-auto px-4 py-12", props.className), children: /* @__PURE__ */ jsx("article", { className: "prose", children: props.children }) }); } function DocsPage({ lastUpdate, editOnGithub, children, ...props }) { const { DocsPage: DocsPage$1, EditOnGitHub: EditOnGitHub$1, PageLastUpdate: PageLastUpdate$1 } = use(LayoutContext) ? page_exports : page_exports$1; return /* @__PURE__ */ jsxs(DocsPage$1, { ...props, children: [children, /* @__PURE__ */ jsxs("div", { className: "flex flex-row flex-wrap items-center justify-between gap-4 empty:hidden", children: [editOnGithub && /* @__PURE__ */ jsx(EditOnGitHub$1, { href: `https://github.com/${editOnGithub.owner}/${editOnGithub.repo}/blob/${editOnGithub.sha}/${editOnGithub.path.startsWith("/") ? editOnGithub.path.slice(1) : editOnGithub.path}` }), lastUpdate && /* @__PURE__ */ jsx(PageLastUpdate$1, { date: new Date(lastUpdate) })] })] }); } //#endregion export { DocsBody, DocsDescription, DocsPage, DocsTitle, EditOnGitHub, PageBreadcrumb, PageLastUpdate, withArticle }; //# sourceMappingURL=page.js.map