Sha256: 2bdeaa91c3dcf0f482b1fbf93cdea57956b69b5130fc39c7a50db5659c06bbee

Contents?: true

Size: 1.43 KB

Versions: 82

Compression:

Stored size: 1.43 KB

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { Grid, Button, Icon } from 'patternfly-react';
import { noop } from 'foremanReact/common/helpers';
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

82 entries across 82 versions & 1 rubygems

Version Path
foreman_rh_cloud-10.0.3 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-11.0.3 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-9.0.59 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-11.0.2 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-11.0.1 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-11.0.0 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-9.0.58 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-10.0.2 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-9.0.57 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-10.0.1 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-9.0.56 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-9.0.55 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-9.0.54 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-9.0.53 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-9.0.52 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-8.0.52 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-9.0.51 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-8.0.51 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-7.0.48 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
foreman_rh_cloud-7.0.47 webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js