diff --git a/frontend/packages/core/src/api/entityView/EntityPageBuilder.tsx b/frontend/packages/core/src/api/entityView/EntityPageBuilder.tsx index 8dbf6ba2a0..19f2e3ec8b 100644 --- a/frontend/packages/core/src/api/entityView/EntityPageBuilder.tsx +++ b/frontend/packages/core/src/api/entityView/EntityPageBuilder.tsx @@ -6,59 +6,51 @@ import { AppComponentBuilder, App } from '../app/types'; import { useEntity, useEntityUri, useEntityConfig } from './EntityContext'; import EntityLink from '../../components/EntityLink/EntityLink'; import BackstagePlugin from '../plugin/Plugin'; +import { Header } from '../..'; +import { + EntityPageNavbarProps, + EntityPageHeaderProps, + EntityPageProps, + EntityPageNavItem, + EntityPageView, +} from './types'; -const EntityLayout: FC<{}> = ({ children }) => { - const config = useEntityConfig(); - return ( -
{children}
- ); -}; +// type AppComponents = { +// EntityPage: ComponentType; +// EntityPageNavbar: ComponentType; +// EntityPageHeader: ComponentType; +// }; -const EntitySidebar: FC<{}> = ({ children }) => { - return {children}; -}; - -const EntitySidebarItem: FC<{ title: string; path: string }> = ({ - title, - path, -}) => { +const DefaultEntityPageNavbar: FC = ({ navItems }) => { const entityUri = useEntityUri(); return ( - - - {title} - - + + {navItems.map(({ title, target }) => ( + + + {title} + + + ))} + ); }; -type EntityPageNavItem = { - title: string; - target: string; +const DefaultEntityPageHeader: FC = () => { + const { id } = useEntity(); + const config = useEntityConfig(); + return
; }; -type EntityPageView = { - path: string; - component: ComponentType; -}; - -type Props = { - navItems: EntityPageNavItem[]; - views: EntityPageView[]; -}; - -const EntityPageComponent: FC = ({ navItems, views }) => { +const DefaultEntityPage: FC = ({ navItems, views }) => { const { kind, id } = useEntity(); const basePath = `/entity/${kind}/${id}`; return ( - - - {navItems.map(({ title, target }) => ( - - ))} - +
+ + {views.map(({ path, component }) => ( = ({ navItems, views }) => { ))} - +
); }; @@ -162,6 +154,6 @@ export default class EntityPageBuilder extends AppComponentBuilder { } } - return () => ; + return () => ; } } diff --git a/frontend/packages/core/src/api/entityView/types.ts b/frontend/packages/core/src/api/entityView/types.ts new file mode 100644 index 0000000000..5e6a5d5df7 --- /dev/null +++ b/frontend/packages/core/src/api/entityView/types.ts @@ -0,0 +1,22 @@ +import { ComponentType } from 'react'; + +export type EntityPageNavItem = { + title: string; + target: string; +}; + +export type EntityPageView = { + path: string; + component: ComponentType; +}; + +export type EntityPageProps = { + navItems: EntityPageNavItem[]; + views: EntityPageView[]; +}; + +export type EntityPageNavbarProps = { + navItems: EntityPageNavItem[]; +}; + +export type EntityPageHeaderProps = {};