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 Icon from '../common/Icon';
8 import { compareCrew } from '../../helpers/Crew';
10 const Crew = ({ crew }) => {
11 const { t } = useTranslation();
13 const commentators = React.useMemo(() =>
14 crew.filter(c => c.role === 'commentary').sort(compareCrew)
16 const trackers = React.useMemo(() =>
17 crew.filter(c => c.role === 'tracking').sort(compareCrew)
19 const techies = React.useMemo(() =>
20 crew.filter(c => c.role === 'setup').sort(compareCrew)
23 return <Row className="episode-crew">
24 {commentators.length ?
26 <div className="fs-5">
27 <Icon.MICROPHONE className="ms-3 me-2" title="" />
28 {t('episodes.commentary')}
30 {commentators.map(c =>
31 <CrewMember crew={c} key={c.id} />
37 <div className="fs-5">
38 <Icon.MOUSE className="ms-3 me-2" title="" />
39 {t('episodes.tracking')}
42 <CrewMember crew={c} key={c.id} />
48 <div className="fs-5">
49 <Icon.MONITOR className="ms-3 me-2" title="" />
53 <CrewMember crew={c} key={c.id} />
61 crew: PropTypes.arrayOf(PropTypes.shape({