@premieroctet/next-admin
Version:
Next-Admin provides a customizable and turnkey admin dashboard for applications built with Next.js and powered by the Prisma ORM. It aims to simplify the development process by providing a turnkey admin system that can be easily integrated into your proje
63 lines (62 loc) • 2.93 kB
JavaScript
import { jsx, jsxs } from "react/jsx-runtime";
import external_lodash_merge_default from "lodash.merge";
import { ThemeProvider } from "next-themes";
import { ColorSchemeProvider } from "../context/ColorSchemeContext.mjs";
import { ConfigProvider } from "../context/ConfigContext.mjs";
import { I18nProvider } from "../context/I18nContext.mjs";
import { MessageProvider } from "../context/MessageContext.mjs";
import { defaultTranslations } from "../i18n.mjs";
import external_Menu_mjs_default from "./Menu.mjs";
const MainLayout = ({ resource, resources, resourcesTitles, customPages, basePath, children, isAppDir, locale, translations, sidebar, resourcesIcons, user, externalLinks, title: titleProp, options, apiBasePath, resourcesIdProperty, schema })=>{
const mergedTranslations = external_lodash_merge_default({
...defaultTranslations
}, translations);
const localePath = locale ? `/${locale}` : "";
const title = titleProp || options?.title;
return /*#__PURE__*/ jsx(ConfigProvider, {
options: options,
basePath: `${localePath}${basePath}`,
isAppDir: isAppDir,
apiBasePath: apiBasePath,
resource: resource,
resourcesIdProperty: resourcesIdProperty,
schema: schema,
nextAdminContext: {
locale
},
children: /*#__PURE__*/ jsx(I18nProvider, {
translations: mergedTranslations,
children: /*#__PURE__*/ jsx(ThemeProvider, {
forcedTheme: options?.forceColorScheme,
storageKey: "theme-next-admin",
defaultTheme: options?.defaultColorScheme,
attribute: "class",
children: /*#__PURE__*/ jsx(ColorSchemeProvider, {
children: /*#__PURE__*/ jsxs("div", {
className: "next-admin__root",
children: [
/*#__PURE__*/ jsx(external_Menu_mjs_default, {
title: title,
resources: resources,
resource: resource,
resourcesTitles: resourcesTitles,
customPages: customPages,
configuration: sidebar,
resourcesIcons: resourcesIcons,
user: user,
externalLinks: externalLinks
}),
/*#__PURE__*/ jsx(MessageProvider, {
children: /*#__PURE__*/ jsx("main", {
className: "lg:pl-72",
children: children
})
})
]
})
})
})
})
});
};
export { MainLayout };