1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { useTranslation } from 'react-i18next';
5 import Icon from '../common/Icon';
7 const Rulesets = ({ technique }) => {
8 const { t } = useTranslation();
10 return <div className="ruleset-box">
11 {['competitive', 'owg', 'mg', 'nl'].map(r =>
12 <span key={r} title={t(`techniques.rulesetDescriptions.${r}`)}>
13 {technique && technique.rulesets && technique.rulesets[r] ?
14 <Icon.ALLOWED className="text-success" />
16 {technique && technique.rulesets && !technique.rulesets[r] ?
17 <Icon.FORBIDDEN className="text-danger" />
19 {!technique || !technique.rulesets ?
23 {t(`techniques.rulesetCodes.${r}`)}
29 Rulesets.propTypes = {
30 technique: PropTypes.shape({
31 rulesets: PropTypes.shape({
36 export default Rulesets;