import React from 'react'; import classNames from 'classnames'; import { PanelModel } from '../panel_model'; import { DashboardModel } from '../dashboard_model'; import { store } from 'app/store/configureStore'; import { updateLocation } from 'app/core/actions'; interface PanelHeaderProps { panel: PanelModel; dashboard: DashboardModel; } export class PanelHeader extends React.Component { onEditPanel = () => { store.dispatch( updateLocation({ query: { panelId: this.props.panel.id, edit: true, fullscreen: true, }, }) ); }; onViewPanel = () => { store.dispatch( updateLocation({ query: { panelId: this.props.panel.id, edit: false, fullscreen: true, }, }) ); }; render() { const isFullscreen = false; const isLoading = false; const panelHeaderClass = classNames({ 'panel-header': true, 'grid-drag-handle': !isFullscreen }); return (
{isLoading && ( )}
{this.props.panel.title} 4m
); } }