Sha256: 9079f094e82baf4f6d5d41fbf37ed16aa29ee1c46eeb9b7c305a874d98fe0151
Contents?: true
Size: 1.21 KB
Versions: 52
Compression:
Stored size: 1.21 KB
Contents
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Switch, FieldLevelHelp } from 'patternfly-react'; import { translate as __ } from 'foremanReact/common/I18n'; import './insightsSyncSwitcher.scss'; class InsightsSyncSwitcher extends Component { handleToggle = () => { const { insightsSyncEnabled, setInsightsSyncEnabled } = this.props; const toggledInsightsSyncEnabled = !insightsSyncEnabled; setInsightsSyncEnabled(toggledInsightsSyncEnabled); }; render() { const { insightsSyncEnabled } = this.props; return ( <div className="insights_sync_switcher"> <span>Synchronize Automatically</span> <FieldLevelHelp content={__( 'Enable automatic synchronization of Insights recommendations from the Red Hat cloud' )} /> <Switch size="mini" value={insightsSyncEnabled} onChange={this.handleToggle} /> </div> ); } } InsightsSyncSwitcher.propTypes = { insightsSyncEnabled: PropTypes.bool, setInsightsSyncEnabled: PropTypes.func.isRequired, }; InsightsSyncSwitcher.defaultProps = { insightsSyncEnabled: true, }; export default InsightsSyncSwitcher;
Version data entries
52 entries across 52 versions & 1 rubygems