AlertingPageWrapper.tsx 619 B

123456789101112131415161718192021222324
  1. import React, { FC } from 'react';
  2. import { useSelector } from 'react-redux';
  3. import Page from 'app/core/components/Page/Page';
  4. import { getNavModel } from 'app/core/selectors/navModel';
  5. import { StoreState } from 'app/types/store';
  6. interface Props {
  7. pageId: string;
  8. isLoading?: boolean;
  9. }
  10. export const AlertingPageWrapper: FC<Props> = ({ children, pageId, isLoading }) => {
  11. const navModel = getNavModel(
  12. useSelector((state: StoreState) => state.navIndex),
  13. pageId
  14. );
  15. return (
  16. <Page navModel={navModel}>
  17. <Page.Contents isLoading={isLoading}>{children}</Page.Contents>
  18. </Page>
  19. );
  20. };