1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Col, Row } from 'react-bootstrap';
4 import { useTranslation } from 'react-i18next';
6 import CrewMember from './CrewMember';
7 import { compareCrew } from '../../helpers/Crew';
9 const Crew = ({ crew }) => {
10 const { t } = useTranslation();
12 const commentators = React.useMemo(() =>
13 crew.filter(c => c.role === 'commentary').sort(compareCrew)
15 const trackers = React.useMemo(() =>
16 crew.filter(c => c.role === 'tracking').sort(compareCrew)
18 const techies = React.useMemo(() =>
19 crew.filter(c => c.role === 'setup').sort(compareCrew)
22 return <Row className="episode-crew">
23 {commentators.length ?
25 <div className="fs-5">
26 {t('episodes.commentary')}
28 {commentators.map(c =>
29 <CrewMember crew={c} key={c.id} />
35 <div className="fs-5">
36 {t('episodes.tracking')}
39 <CrewMember crew={c} key={c.id} />
45 <div className="fs-5">
49 <CrewMember crew={c} key={c.id} />
57 crew: PropTypes.arrayOf(PropTypes.shape({