X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=resources%2Fjs%2Fcomponents%2Fepisodes%2FItem.js;h=3545e7734586a1f3006ad761621df9061fb15d10;hb=ff1f7c9fc9660ec838fb626cf6543201531020bb;hp=8f1bafcb240508500e0336768c3a4af99d70b4ef;hpb=dec43db11e9433f5bfcfaa091518082559cb3169;p=alttp.git diff --git a/resources/js/components/episodes/Item.js b/resources/js/components/episodes/Item.js index 8f1bafc..3545e77 100644 --- a/resources/js/components/episodes/Item.js +++ b/resources/js/components/episodes/Item.js @@ -1,35 +1,123 @@ +import moment from 'moment'; import PropTypes from 'prop-types'; import React from 'react'; +import { Button } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; +import Channels from './Channels'; +import Crew from './Crew'; +import MultiLink from './MultiLink'; import Players from './Players'; +import Icon from '../common/Icon'; +import { canApplyForEpisode, canRestreamEpisode } from '../../helpers/permissions'; +import { withUser } from '../../helpers/UserContext'; -const Item = ({ episode }) => { +const isActive = episode => { + if (!episode.start) return false; + const now = moment(); + const start = moment(episode.start).subtract(10, 'minutes'); + const end = moment(episode.start).add(episode.estimate, 'seconds'); + return start.isBefore(now) && end.isAfter(now); +}; + +const Item = ({ episode, onAddRestream, onApply, onEditRestream, user }) => { const { t } = useTranslation(); - return