import React, { CSSProperties, PureComponent } from 'react'; import PropTypes from 'prop-types'; import { ActionCreators, LiftedAction } from '@redux-devtools/core'; import { Base16Theme } from 'redux-devtools-themes'; import { Action, Dispatch } from 'redux'; import LogMonitorButton from './LogMonitorButton'; import { LogMonitorAction } from './actions'; import { LogMonitorState } from './reducers'; // eslint-disable-next-line @typescript-eslint/unbound-method const { reset, rollback, commit, sweep } = ActionCreators; const style: CSSProperties = { textAlign: 'center', borderBottomWidth: 1, borderBottomStyle: 'solid', borderColor: 'transparent', zIndex: 1, display: 'flex', flexDirection: 'row', }; interface Props> { theme: Base16Theme; dispatch: Dispatch>; hasStates: boolean; hasSkippedActions: boolean; } export default class LogMonitorButtonBar< S, A extends Action, > extends PureComponent> { static propTypes = { dispatch: PropTypes.func, theme: PropTypes.object, }; handleRollback = () => { this.props.dispatch(rollback()); }; handleSweep = () => { this.props.dispatch(sweep()); }; handleCommit = () => { this.props.dispatch(commit()); }; handleReset = () => { this.props.dispatch(reset()); }; render() { const { theme, hasStates, hasSkippedActions } = this.props; return (
Reset Revert Sweep Commit
); } }