2022-09-05 07:56:08 -05:00
|
|
|
import React, { useContext } from 'react';
|
|
|
|
|
|
|
|
import { PluginPageProps } from '@grafana/runtime';
|
|
|
|
import { PluginPageContext } from 'app/features/plugins/components/PluginPageContext';
|
|
|
|
|
|
|
|
import { Page } from '../Page/Page';
|
|
|
|
|
2022-11-09 03:05:01 -06:00
|
|
|
export function PluginPage({ actions, children, info, pageNav, layout, renderTitle, subTitle }: PluginPageProps) {
|
2022-09-05 07:56:08 -05:00
|
|
|
const context = useContext(PluginPageContext);
|
|
|
|
|
|
|
|
return (
|
2022-11-09 03:05:01 -06:00
|
|
|
<Page
|
|
|
|
navModel={context.sectionNav}
|
|
|
|
pageNav={pageNav}
|
|
|
|
layout={layout}
|
|
|
|
actions={actions}
|
|
|
|
renderTitle={renderTitle}
|
|
|
|
info={info}
|
|
|
|
subTitle={subTitle}
|
|
|
|
>
|
2022-09-05 07:56:08 -05:00
|
|
|
<Page.Contents>{children}</Page.Contents>
|
|
|
|
</Page>
|
|
|
|
);
|
|
|
|
}
|