Sha256: eaddcec551f47c44e536314b5f1659f36ef239bcfc4942c38a46496ff5fad7f3

Contents?: true

Size: 1006 Bytes

Versions: 67

Compression:

Stored size: 1006 Bytes

Contents

import React from 'react';
import PropTypes from 'prop-types';
import {
  CheckCircleIcon,
  ExclamationCircleIcon,
  QuestionCircleIcon,
} from '@patternfly/react-icons';
import { JOB_SUCCESS_STATUS, JOB_ERROR_STATUS } from './constants';
import './styles.scss';

const JobStatusIcon = ({ status, children, ...props }) => {
  switch (status) {
    case JOB_SUCCESS_STATUS:
      return (
        <span className="job-success">
          <CheckCircleIcon {...props} /> {children}
        </span>
      );
    case JOB_ERROR_STATUS:
      return (
        <span className="job-error">
          <ExclamationCircleIcon {...props} /> {children}
        </span>
      );
    default:
      return (
        <span className="job-info">
          <QuestionCircleIcon {...props} /> {children}
        </span>
      );
  }
};

JobStatusIcon.propTypes = {
  status: PropTypes.number,
  children: PropTypes.string.isRequired,
};

JobStatusIcon.defaultProps = {
  status: undefined,
};

export default JobStatusIcon;

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
foreman_remote_execution-9.0.1 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-9.0.0 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-8.1.2 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-8.1.1 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-8.1.0 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-7.2.2 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-7.2.1 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-7.2.0 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-5.0.8 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-8.0.0 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-7.1.1 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-7.1.0 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-7.0.0 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-5.0.7 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-5.0.6 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-6.2.0 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-5.0.5 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-6.1.0 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-5.0.4 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-5.0.3 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js