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`;
77 case 'crystal-switch':
78 case 'crystal-switch-blue':
79 case 'crystal-switch-red':
80 return `/icon/${name}.png`;
86 const ZeldaIcon = ({ name }) => {
87 const { t } = useTranslation();
89 const invert = name.startsWith('not-');
90 const strippedName = invert ? name.substr(4) : name;
91 const title = t(`icon.zelda.${name}`);
93 return <span className="zelda-icon">
96 src={getIconURL(strippedName)}
100 <span className="strike">
101 <Icon.SLASH title="" />
107 ZeldaIcon.propTypes = {
108 name: PropTypes.string,
111 export default ZeldaIcon;