Sha256: edb8b95f52d242eb24270b5a1324ea9b7a4b12fca567e4f2681b1ea1e7bd090e

Contents?: true

Size: 837 Bytes

Versions: 59

Compression:

Stored size: 837 Bytes

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { Switch } from '@patternfly/react-core';
import { HelpLabel } from './HelpLabel';
import './SwitcherPF4.scss';

const SwitcherPF4 = ({ id, label, tooltip, isChecked, onChange }) => (
  <Switch
    className="foreman-rh-cloud-switcher"
    id={`rh-cloud-switcher-${id}`}
    isChecked={isChecked}
    onChange={onChange}
    label={
      <div>
        {label}
        <HelpLabel text={tooltip} id={id} className="switcher-help-label" />
      </div>
    }
  />
);

SwitcherPF4.propTypes = {
  id: PropTypes.string.isRequired,
  label: PropTypes.string,
  tooltip: PropTypes.string,
  isChecked: PropTypes.bool,
  onChange: PropTypes.func.isRequired,
};

SwitcherPF4.defaultProps = {
  label: null,
  tooltip: null,
  isChecked: true,
};

export default SwitcherPF4;

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
foreman_rh_cloud-11.0.3 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-9.0.59 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-11.0.2 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-11.0.1 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-11.0.0 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-9.0.58 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-10.0.2 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-9.0.57 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-10.0.1 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-9.0.56 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-9.0.55 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-9.0.54 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-9.0.53 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-9.0.52 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-8.0.52 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-9.0.51 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-8.0.51 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-7.0.48 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-7.0.47 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-8.0.50 webpack/common/Switcher/SwitcherPF4.js