]> git.localhorst.tv Git - alttp.git/blob - resources/js/components/techniques/List.js
more content variety
[alttp.git] / resources / js / components / techniques / List.js
1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Link } from 'react-router-dom';
4
5 import {
6         getLink,
7         getTranslation,
8 } from '../../helpers/Technique';
9 import i18n from '../../i18n';
10
11 const List = ({ techniques }) => <ul className="tech-list">
12         {techniques.map(tech =>
13                 <li key={tech.id}>
14                         <h2>
15                                 <Link to={getLink(tech)}>
16                                         {getTranslation(tech, 'title', i18n.language)}
17                                 </Link>
18                         </h2>
19                         <p>{getTranslation(tech, 'short', i18n.language)}</p>
20                 </li>
21         )}
22 </ul>;
23
24 List.propTypes = {
25         techniques: PropTypes.arrayOf(PropTypes.shape({
26                 id: PropTypes.number,
27                 name: PropTypes.string,
28         })),
29 };
30
31 export default List;