import * as React from 'react'; import { JSXElementConstructor, ReactElement } from 'react'; import { AppShell, AppShellProps } from '@mantine/core'; import { useVisynAppContext } from './VisynAppContext'; import { VisynHeader } from './header/VisynHeader'; import { VisynLoginMenu } from './login/VisynLoginMenu'; /** * * @param header Optional custom header to be passed to the AppShell. If not provided, will use an empty VisynHeader. * @param navbar Optional navbar component to be passed to AppShell. * @param aside Optional aside component to be passed to AppShell * @param footer Optional footer component to be passed to AppShell * @param appShellProps Optional props to be passed directly to AppShell * @param loginMenu Optional custom login menu. If not passed, will default to the VisynLoginMenu. * @param headerHeight Optional height for the header, so that you can properly use 100% inside of your application. Does not set the height of the header, just calculates height elsewhere based on this number * @returns */ export function VisynApp({ header = null, headerConfig = {}, navbar = null, navbarConfig = null, footer = null, footerConfig = null, appShellProps = null, children, loginMenu = , }: { header?: ReactElement> | null; headerConfig?: Partial | null; navbar?: ReactElement> | null; navbarConfig?: AppShellProps['navbar'] | null; aside?: ReactElement> | null; footer?: ReactElement> | null; footerConfig?: AppShellProps['footer'] | null; appShellProps?: Partial> | null; loginMenu?: JSX.Element | null; children?: React.ReactNode; }) { useVisynAppContext(); return ( {navbar} {footer} {header || } {children} {loginMenu} ); }