import { MantineProvider } from "@mantine/core"; import { Notifications } from "@mantine/notifications"; import React, { type ReactNode } from "react"; import { BkndProvider } from "ui/client/bknd"; import { useTheme, type AppTheme } from "ui/client/use-theme"; import { Logo } from "ui/components/display/Logo"; import * as AppShell from "ui/layouts/AppShell/AppShell"; import { ClientProvider, useBkndWindowContext, type ClientProviderProps } from "bknd/client"; import { createMantineTheme } from "./lib/mantine/theme"; import { Routes } from "./routes"; import type { BkndAdminAppShellOptions, BkndAdminEntitiesOptions } from "./options"; export type BkndAdminConfig = { /** * Base path of the Admin UI * @default `/` */ basepath?: string; /** * Path to return to when clicking the logo * @default `/` */ logo_return_path?: string; /** * Theme of the Admin UI * @default `system` */ theme?: AppTheme; /** * Entities configuration like headers, footers, actions, field renders, etc. */ entities?: BkndAdminEntitiesOptions; /** * App shell configuration like user menu actions. */ appShell?: BkndAdminAppShellOptions; }; export type BkndAdminProps = { /** * Base URL of the API, only needed if you are not using the `withProvider` prop */ baseUrl?: string; /** * Whether to wrap Admin in a `` */ withProvider?: boolean | ClientProviderProps; /** * Admin UI customization options */ config?: BkndAdminConfig; children?: ReactNode; }; export default function Admin(props: BkndAdminProps) { const Provider = ({ children }: any) => props.withProvider ? ( {children} ) : ( children ); return ( ); } function AdminInner(props: BkndAdminProps) { const { theme } = useTheme(); const config = { ...props.config, ...useBkndWindowContext(), }; const BkndWrapper = ({ children }: { children: ReactNode }) => ( }> {children} ); return ( {props.children} ); } const Skeleton = ({ theme }: { theme?: any }) => { const t = useTheme(); const actualTheme = theme && ["dark", "light"].includes(theme) ? theme : t.theme; return (
{/*Loading*/}
); };