Sha256: 48c3ade9204da1ab4879dde6d74d2456b3ed33b2c8ebbfb708a39329e3f9db32

Contents?: true

Size: 1017 Bytes

Versions: 25

Compression:

Stored size: 1017 Bytes

Contents

import React from 'react';
import PropTypes from 'prop-types';

import SeverityCritical from './i_severity-critical.svg';
import SeverityHigh from './i_severity-high.svg';
import SeverityMedium from './i_severity-med.svg';
import SeverityLow from './i_severity-low.svg';
import SeverityUnknown from './i_unknown.svg';

import './RuleSeverity.scss';

const RuleSeverity = props => {
  const propsMapping = {
    low: { alt: 'Low Serverity', src: SeverityLow },
    medium: { alt: 'Medium Serverity', src: SeverityMedium },
    high: { alt: 'High Serverity', src: SeverityHigh },
    critical: {
      alt: 'Critical Serverity',
      src: SeverityCritical,
    },
    unknown: { alt: 'Unknown Serverity', src: SeverityUnknown },
  };

  const imgProps = propsMapping[props.severity] || propsMapping.unknown;
  // eslint-disable-next-line jsx-a11y/alt-text
  return <img {...imgProps} className="severity-img" />;
};

RuleSeverity.propTypes = {
  severity: PropTypes.string.isRequired,
};

export default RuleSeverity;

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
foreman_openscap-10.1.0 webpack/components/RuleSeverity/index.js
foreman_openscap-10.0.3 webpack/components/RuleSeverity/index.js
foreman_openscap-10.0.2 webpack/components/RuleSeverity/index.js
foreman_openscap-10.0.1 webpack/components/RuleSeverity/index.js
foreman_openscap-10.0.0 webpack/components/RuleSeverity/index.js
foreman_openscap-9.0.4 webpack/components/RuleSeverity/index.js
foreman_openscap-9.0.3 webpack/components/RuleSeverity/index.js
foreman_openscap-9.0.2 webpack/components/RuleSeverity/index.js
foreman_openscap-9.0.1 webpack/components/RuleSeverity/index.js
foreman_openscap-9.0.0 webpack/components/RuleSeverity/index.js
foreman_openscap-8.0.0 webpack/components/RuleSeverity/index.js
foreman_openscap-7.1.1 webpack/components/RuleSeverity/index.js
foreman_openscap-7.1.0 webpack/components/RuleSeverity/index.js
foreman_openscap-7.0.0 webpack/components/RuleSeverity/index.js
foreman_openscap-6.0.0 webpack/components/RuleSeverity/index.js
foreman_openscap-5.2.3 webpack/components/RuleSeverity/index.js
foreman_openscap-5.2.2 webpack/components/RuleSeverity/index.js
foreman_openscap-5.1.1 webpack/components/RuleSeverity/index.js
foreman_openscap-5.2.1 webpack/components/RuleSeverity/index.js
foreman_openscap-5.2.0 webpack/components/RuleSeverity/index.js