Sha256: 34f22496660be02c53efd5f406b72a040f8c16261a915f2892365ed6941be0f1

Contents?: true

Size: 1.39 KB

Versions: 22

Compression:

Stored size: 1.39 KB

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { noop, Grid, Button, Icon } from 'patternfly-react';
import { sprintf, translate as __ } from 'foremanReact/common/I18n';
import { isExitCodeLoading } from '../../ForemanInventoryHelpers';
import './tabHeader.scss';

const TabHeader = ({ exitCode, onRestart, onDownload, toggleFullScreen }) => (
  <Grid.Row className="tab-header">
    <Grid.Col sm={6}>
      <p>{sprintf(__('Exit Code: %s'), exitCode)}</p>
    </Grid.Col>
    <Grid.Col sm={6}>
      <div className="tab-action-buttons">
        {onRestart ? (
          <Button
            bsStyle="primary"
            onClick={onRestart}
            disabled={isExitCodeLoading(exitCode)}
          >
            {__('Restart')}
          </Button>
        ) : null}
        {onDownload ? (
          <Button onClick={onDownload}>
            {__('Download Report')} <Icon name="download" />
          </Button>
        ) : null}
        <Button onClick={toggleFullScreen}>
          {__('Full Screen')}
          <Icon name="arrows-alt" />
        </Button>
      </div>
    </Grid.Col>
  </Grid.Row>
);

TabHeader.propTypes = {
  onRestart: PropTypes.func,
  onDownload: PropTypes.func,
  exitCode: PropTypes.string,
  toggleFullScreen: PropTypes.func,
};

TabHeader.defaultProps = {
  onRestart: null,
  exitCode: '',
  onDownload: null,
  toggleFullScreen: noop,
};

export default TabHeader;

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
foreman_rh_cloud-2.0.18.1 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-1.0.18 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-2.0.18 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-1.0.17 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-2.0.17 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-3.0.17 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-2.0.16 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-1.0.16 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-3.0.16 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-1.0.15 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-2.0.15 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-3.0.15 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-3.0.14 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-2.0.14 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-1.0.14 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-0.9.14 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-0.9.13.1 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-1.0.13.1 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-2.0.13.1 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-0.9.13 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js