added bknd admin config override to make it easier to include <Admin />

This commit is contained in:
dswbx
2024-11-28 11:15:07 +01:00
parent 54b38401d8
commit bdc6eb55bf
14 changed files with 103 additions and 59 deletions

View File

@@ -1,5 +1,6 @@
import { MantineProvider } from "@mantine/core";
import { Notifications } from "@mantine/notifications";
import type { ModuleConfigs } from "modules";
import React from "react";
import { FlashMessage } from "ui/modules/server/FlashMessage";
import { BkndProvider, ClientProvider, type ClientProviderProps, useBknd } from "./client";
@@ -10,12 +11,16 @@ import { Routes } from "./routes";
export type BkndAdminProps = {
baseUrl?: string;
withProvider?: boolean | ClientProviderProps;
// @todo: add admin config override
config?: ModuleConfigs["server"]["admin"];
};
export default function Admin({ baseUrl: baseUrlOverride, withProvider = false }: BkndAdminProps) {
export default function Admin({
baseUrl: baseUrlOverride,
withProvider = false,
config
}: BkndAdminProps) {
const Component = (
<BkndProvider>
<BkndProvider adminOverride={config}>
<AdminInternal />
</BkndProvider>
);