grafana/public/app/features/manage-dashboards/SnapshotListPage.tsx
Alexander Tymchuk 702e007de4
Migration: snapshot list (#24266)
* Migration: snapshots list

* chore: converted SnapshotListPage to functional component

* fix: dependencies for doRemoveSnapshot
2020-05-06 10:11:25 +02:00

31 lines
904 B
TypeScript

import React, { FC } from 'react';
import { MapStateToProps, connect } from 'react-redux';
import { NavModel } from '@grafana/data';
import Page from 'app/core/components/Page/Page';
import { getUrl } from 'app/core/selectors/location';
import { StoreState } from 'app/types';
import { SnapshotListTable } from './components/SnapshotListTable';
import { getDashboardNavModel } from './state/selectors';
interface Props {
navModel: NavModel;
url: string;
}
export const SnapshotListPage: FC<Props> = ({ navModel, url }) => {
return (
<Page navModel={navModel}>
<Page.Contents>
<SnapshotListTable url={url} />
</Page.Contents>
</Page>
);
};
const mapStateToProps: MapStateToProps<Props, {}, StoreState> = (state: StoreState) => ({
navModel: getDashboardNavModel(state),
url: getUrl(state.location),
});
export default connect(mapStateToProps)(SnapshotListPage);