]> git.localhorst.tv Git - alttp.git/blob - resources/js/components/techniques/Requirements.js
svg dungeon tracker
[alttp.git] / resources / js / components / techniques / Requirements.js
1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { useTranslation } from 'react-i18next';
4
5 import Requirement from './Requirement';
6
7 const Requirements = ({ technique }) => {
8         const { t } = useTranslation();
9
10         if (!technique.requirements || !technique.requirements.length) {
11                 return null;
12         }
13
14         return <div className="tech-requirements mb-3">
15                 {t('techniques.requirements')}
16                 <ul>
17                         {technique.requirements.map((r, i) =>
18                                 <li key={i}>
19                                         <Requirement requirement={r} />
20                                 </li>
21                         )}
22                 </ul>
23         </div>;
24 };
25
26 Requirements.propTypes = {
27         technique: PropTypes.shape({
28                 requirements: PropTypes.arrayOf(
29                         PropTypes.arrayOf(PropTypes.string),
30                 ),
31         }),
32 };
33
34 export default Requirements;