grafana/public/app/features/folders/FolderAlerting.tsx
Josh Hunt 3c6e0e8ef8
Chore: ESlint import order (#44959)
* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
2022-04-22 14:33:13 +01:00

37 lines
1.2 KiB
TypeScript

import React from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { useAsync } from 'react-use';
import Page from 'app/core/components/Page/Page';
import { GrafanaRouteComponentProps } from 'app/core/navigation/types';
import { getNavModel } from 'app/core/selectors/navModel';
import { StoreState } from 'app/types';
import { AlertsFolderView } from '../alerting/unified/AlertsFolderView';
import { getFolderByUid } from './state/actions';
import { getLoadingNav } from './state/navModel';
export interface OwnProps extends GrafanaRouteComponentProps<{ uid: string }> {}
const FolderAlerting = ({ match }: OwnProps) => {
const dispatch = useDispatch();
const navIndex = useSelector((state: StoreState) => state.navIndex);
const folder = useSelector((state: StoreState) => state.folder);
const uid = match.params.uid;
const navModel = getNavModel(navIndex, `folder-alerting-${uid}`, getLoadingNav(1));
const { loading } = useAsync(async () => dispatch(getFolderByUid(uid)), [getFolderByUid, uid]);
return (
<Page navModel={navModel}>
<Page.Contents isLoading={loading}>
<AlertsFolderView folder={folder} />
</Page.Contents>
</Page>
);
};
export default FolderAlerting;