import React, { PureComponent } from 'react'; import { ExploreId } from 'app/types/explore'; import { DataSourcePicker } from 'app/core/components/Select/DataSourcePicker'; import { DataSourceSelectItem, RawTimeRange, TimeRange } from '@grafana/ui'; import TimePicker from './TimePicker'; interface Props { datasourceMissing: boolean; exploreDatasources: DataSourceSelectItem[]; exploreId: ExploreId; loading: boolean; range: RawTimeRange; selectedDatasource: DataSourceSelectItem; splitted: boolean; onChangeDatasource: (option) => void; onClearAll: () => void; onCloseSplit: () => void; onChangeTime: (range: TimeRange, changedByScanner?: boolean) => void; onRunQuery: () => void; onSplit: () => void; } export class ExploreToolbar extends PureComponent { /** * Timepicker to control scanning */ timepickerRef: React.RefObject; constructor(props) { super(props); this.timepickerRef = React.createRef(); } render() { const { datasourceMissing, exploreDatasources, exploreId, loading, range, selectedDatasource, splitted, } = this.props; return (
{exploreId === 'left' ? (
Explore
) : ( <>
)} {!datasourceMissing ? (
) : null}
{exploreId === 'left' && !splitted ? (
) : null}
); } }