X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fepisodes%2FItem.js;h=71fe49ed5c6875eb00d34848143160a75576fc02;hb=638802eaf20d636c16d7ce337ace508708705f2c;hp=5c6982972a6dbd57ca176bdfe0b296abb889d7ba;hpb=ed531959edb865805c828f2c318146c43f6e581b;p=alttp.git diff --git a/resources/js/components/episodes/Item.js b/resources/js/components/episodes/Item.js index 5c69829..71fe49e 100644 --- a/resources/js/components/episodes/Item.js +++ b/resources/js/components/episodes/Item.js @@ -1,12 +1,16 @@ 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 { canRestreamEpisode } from '../../helpers/permissions'; +import { withUser } from '../../helpers/UserContext'; const isActive = episode => { if (!episode.start) return false; @@ -16,7 +20,7 @@ const isActive = episode => { return start.isBefore(now) && end.isAfter(now); }; -const Item = ({ episode }) => { +const Item = ({ episode, onAddRestream, onEditRestream, user }) => { const { t } = useTranslation(); const classNames = [ @@ -53,13 +57,29 @@ const Item = ({ episode }) => { : null} -
+
{hasChannels ? - + : null} {!hasChannels && hasPlayers ? : null} + {onAddRestream && canRestreamEpisode(user, episode) ? +
+ +
+ : null}
{hasPlayers ? @@ -86,6 +106,10 @@ Item.propTypes = { start: PropTypes.string, title: PropTypes.string, }), + onAddRestream: PropTypes.func, + onEditRestream: PropTypes.func, + user: PropTypes.shape({ + }), }; -export default Item; +export default withUser(Item);