Sha256: aee97b72f3db0384aeb44a54166069a9b0938ac628dda792faf1f3839eefa4f0

Contents?: true

Size: 828 Bytes

Versions: 25

Compression:

Stored size: 828 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-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

25 entries across 25 versions & 1 rubygems

Version Path
foreman_rh_cloud-3.0.33 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-3.0.32 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-3.0.29 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-3.0.28 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-3.0.26 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-3.0.25 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-4.0.25 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-3.0.24.1 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-4.0.24.1 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-3.0.24 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-4.0.24 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-3.0.23 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-4.0.23 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-3.0.22 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-4.0.22 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-4.0.21.1 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-3.0.21.1 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-3.0.21 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-3.0.20 webpack/common/Switcher/SwitcherPF4.js
foreman_rh_cloud-3.0.19 webpack/common/Switcher/SwitcherPF4.js