import React from 'react'; import PropTypes from 'prop-types'; import { CheckCircleIcon, ExclamationCircleIcon, BuildIcon, RunningIcon, ExclamationTriangleIcon, QuestionCircleIcon, } from '@patternfly/react-icons'; import { JOB_SUCCESS_STATUS, JOB_ERROR_STATUS, JOB_PLANNED_STATUS, JOB_RUNNING_STATUS, JOB_CANCELLED_STATUS, JOB_AWAITING_STATUS, } from './constants'; import './styles.scss'; const JobStatusIcon = ({ status, children, ...props }) => { switch (status) { case JOB_SUCCESS_STATUS: return ( {children} ); case JOB_ERROR_STATUS: return ( {children} ); case JOB_PLANNED_STATUS: return ( {children} ); case JOB_RUNNING_STATUS: return ( {children} ); case JOB_CANCELLED_STATUS: return ( {' '} {children} ); case JOB_AWAITING_STATUS: return {children}; default: return ( {children} ); } }; JobStatusIcon.propTypes = { status: PropTypes.number, children: PropTypes.string.isRequired, }; JobStatusIcon.defaultProps = { status: undefined, }; export default JobStatusIcon;