1 import moment from 'moment';
2 import PropTypes from 'prop-types';
3 import React from 'react';
5 import Item from './Item';
7 const List = ({ episodes, onAddRestream, onApply, onEditRestream }) => {
8 const grouped = React.useMemo(() => episodes.reduce((groups, episode) => {
9 const day = moment(episode.start).format('YYYY-MM-DD');
19 return <div className="episodes-list">
20 {Object.entries(grouped).map(([day, group]) => <div key={day}>
21 <h2 className="text-center episodes-group-heading">
22 {moment(day).format('dddd, L')}
27 onAddRestream={onAddRestream}
29 onEditRestream={onEditRestream}
38 episodes: PropTypes.arrayOf(PropTypes.shape({
39 start: PropTypes.string,
41 onAddRestream: PropTypes.func,
42 onApply: PropTypes.func,
43 onEditRestream: PropTypes.func,