]> git.localhorst.tv Git - alttp.git/blob - resources/js/components/episodes/DialogEpisode.js
compact keysanity tracker
[alttp.git] / resources / js / components / episodes / DialogEpisode.js
1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { useTranslation } from 'react-i18next';
4
5 import { getName } from '../../helpers/Crew';
6
7 const DialogEpisode = ({ episode }) => {
8         const { t } = useTranslation();
9
10         if (!episode) return null;
11
12         return <>
13                 <div>
14                         {episode.event.title}
15                 </div>
16                 <div>
17                         {t('episodes.startTime', { date: new Date(episode.start) })}
18                 </div>
19                 <div>
20                         {episode.players.map(p => getName(p)).join(', ')}
21                 </div>
22         </>;
23 };
24
25 DialogEpisode.propTypes = {
26         episode: PropTypes.shape({
27                 event: PropTypes.shape({
28                         title: PropTypes.string,
29                 }),
30                 players: PropTypes.arrayOf(PropTypes.shape({
31                 })),
32                 start: PropTypes.string,
33         }),
34 };
35
36 export default DialogEpisode;