1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { useTranslation } from 'react-i18next';
5 import Icon from './Icon';
7 const getIconURL = name => {
10 case 'blue-boomerang':
29 case 'fighter-shield':
39 case 'heart-container':
61 return `/item/${name}.png`;
67 const ZeldaIcon = ({ name }) => {
68 const { t } = useTranslation();
70 const invert = name.startsWith('not-');
71 const strippedName = invert ? name.substr(4) : name;
72 const title = t(`icon.zelda.${name}`);
74 return <span className="zelda-icon">
77 src={getIconURL(strippedName)}
81 <span className="strike">
82 <Icon.SLASH title="" />
88 ZeldaIcon.propTypes = {
89 name: PropTypes.string,
92 export default ZeldaIcon;