UNPKG

fumadocs-ui

Version:

The Radix UI version of Fumadocs UI

39 lines (36 loc) 1.14 kB
'use client'; import { jsx } from "react/jsx-runtime"; import { lazy } from "react"; import { I18nProvider } from "@fumadocs/ui/contexts/i18n"; import { SearchProvider } from "@fumadocs/ui/contexts/search"; import { DirectionProvider } from "@radix-ui/react-direction"; import { ThemeProvider } from "next-themes"; //#region src/provider/base.tsx const DefaultSearchDialog = lazy(() => import("../components/dialog/search-default.js")); function RootProvider({ children, dir = "ltr", theme = {}, search, i18n }) { let body = children; if (search?.enabled !== false) body = /* @__PURE__ */ jsx(SearchProvider, { SearchDialog: DefaultSearchDialog, ...search, children: body }); if (theme?.enabled !== false) body = /* @__PURE__ */ jsx(ThemeProvider, { attribute: "class", defaultTheme: "system", enableSystem: true, disableTransitionOnChange: true, ...theme, children: body }); if (i18n) body = /* @__PURE__ */ jsx(I18nProvider, { ...i18n, children: body }); return /* @__PURE__ */ jsx(DirectionProvider, { dir, children: body }); } //#endregion export { RootProvider }; //# sourceMappingURL=base.js.map