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-10.1.1 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-11.1.1 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-11.1.0 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-10.1.0 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-8.3.3 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-8.3.2 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-11.0.0 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-10.0.7 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-8.3.1 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-10.0.6 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-10.0.5 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-10.0.4 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-10.0.3 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-10.0.2 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-10.0.1 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-10.0.0 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-8.3.0 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-9.1.0 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-8.2.1 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
foreman_remote_execution-8.2.0 webpack/react_app/components/RecentJobsCard/JobStatusIcon.js