import React, { FC } from 'react'; import { connect, MapStateToProps } from 'react-redux'; import { NavModel } from '@grafana/data'; import { locationService } from '@grafana/runtime'; import { useStyles2 } from '@grafana/ui'; import Page from 'app/core/components/Page/Page'; import { getNavModel } from 'app/core/selectors/navModel'; import { StoreState } from 'app/types'; import { GrafanaRouteComponentProps } from '../../core/navigation/types'; import { PlaylistForm } from './PlaylistForm'; import { createPlaylist } from './api'; import { getPlaylistStyles } from './styles'; import { Playlist } from './types'; import { usePlaylist } from './usePlaylist'; interface ConnectedProps { navModel: NavModel; } interface Props extends ConnectedProps, GrafanaRouteComponentProps {} export const PlaylistNewPage: FC = ({ navModel }) => { const styles = useStyles2(getPlaylistStyles); const { playlist, loading } = usePlaylist(); const onSubmit = async (playlist: Playlist) => { await createPlaylist(playlist); locationService.push('/playlists'); }; return (

New Playlist

A playlist rotates through a pre-selected list of dashboards. A playlist can be a great way to build situational awareness, or just show off your metrics to your team or visitors.

); }; const mapStateToProps: MapStateToProps = (state: StoreState) => ({ navModel: getNavModel(state.navIndex, 'playlists'), }); export default connect(mapStateToProps)(PlaylistNewPage);