import QosSelect from './QosSelect' import React from 'react' import { Checkbox, FormControlLabel, Tooltip } from '@material-ui/core' import { publishActions } from '../../../actions' import { bindActionCreators } from 'redux' import { AppState } from '../../../reducers' import { connect } from 'react-redux' export function RetainSwitch(props: { retain: boolean; actions: typeof publishActions }) { const labelStyle = { margin: '0 8px 0 8px' } return (
} label="QoS" labelPlacement="start" /> } label="retain" labelPlacement="end" />
) } const mapDispatchToProps = (dispatch: any) => { return { actions: bindActionCreators(publishActions, dispatch), } } const mapStateToProps = (state: AppState) => { return { retain: state.publish.retain, } } export default connect(mapStateToProps, mapDispatchToProps)(RetainSwitch)