components.pages.DefaultPage.tsx Maven / Gradle / Ivy
import React from 'react'
import classNames from 'classnames'
import Alert from '../snippets/Alerts/Alert'
import { PageTitle, PageTitle as DocumentTitle } from '../core/PageTitle'
import { BreadcrumbContainer } from '../core/Breadcrumb/BreadcrumbContainer'
import Toolbar from '../buttons/Toolbar'
import { ModelPrefix } from '../../core/datasource/const'
import { type DefaultPageProps } from './types'
import { usePageRegister } from './usePageRegister'
export const DefaultPage = ({
metadata,
toolbar,
entityKey,
error,
children,
disabled,
dispatch,
rootPage = false,
}: DefaultPageProps) => {
const { style, className, datasources, id: pageId, page } = metadata || {}
const { title, htmlTitle, datasource, model: modelPrefix } = page || {}
usePageRegister(dispatch, datasources, pageId)
return (
{error && }
{rootPage && (
)}
{toolbar && (toolbar.topLeft || toolbar.topRight || toolbar.topCenter) && (
)}
{children}
{
toolbar && (toolbar.bottomLeft || toolbar.bottomRight || toolbar.bottomCenter) &&
(
)
}
)
}
DefaultPage.defaultProps = {
toolbar: {},
}
export default DefaultPage
© 2015 - 2025 Weber Informatics LLC | Privacy Policy