import React from "react"; import { observer } from "mobx-react"; import { Toolbar } from "eez-studio-ui/toolbar"; import { ButtonAction } from "eez-studio-ui/action"; import type { IChartsController } from "eez-studio-ui/chart/chart"; //////////////////////////////////////////////////////////////////////////////// interface IWaveform { openConfigurationDialog?: () => void; } export interface IToolbarOptions { showConfigureButton: boolean; } export const WaveformToolbar = observer( class WaveformToolbar extends React.Component< { chartsController: IChartsController; waveform: IWaveform; options?: IToolbarOptions; }, {} > { configureChart = () => { if (this.props.waveform.openConfigurationDialog) { this.props.waveform.openConfigurationDialog(); } }; render() { return ( {this.props.waveform.openConfigurationDialog && (!this.props.options || this.props.options.showConfigureButton) && ( )} ); } } );