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':
40 case 'heart-container':
62 return `/item/${name}.png`;
76 return `/dungeon/${name.substr(8)}.png`;
82 const ZeldaIcon = ({ name }) => {
83 const { t } = useTranslation();
85 const invert = name.startsWith('not-');
86 const strippedName = invert ? name.substr(4) : name;
87 const title = t(`icon.zelda.${name}`);
89 return <span className="zelda-icon">
92 src={getIconURL(strippedName)}
96 <span className="strike">
97 <Icon.SLASH title="" />
103 ZeldaIcon.propTypes = {
104 name: PropTypes.string,
107 export default ZeldaIcon;