X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fepisodes%2FChannel.js;h=e2d25d72bf209e59a69fc3d1ca36c79618a3f8cd;hb=13ffde5b2abcf831af9c794044350737066c5933;hp=1943753617095c1da4b5da6075f77c6f1b05f892;hpb=15132749249f6418fd5695547b5c323a0ad10939;p=alttp.git diff --git a/resources/js/components/episodes/Channel.js b/resources/js/components/episodes/Channel.js index 1943753..e2d25d7 100644 --- a/resources/js/components/episodes/Channel.js +++ b/resources/js/components/episodes/Channel.js @@ -3,9 +3,13 @@ import React from 'react'; import { Button } from 'react-bootstrap'; import Icon from '../common/Icon'; +import { mayEditRestream } from '../../helpers/permissions'; +import { useUser } from '../../hooks/user'; -const Channel = ({ channel }) => -
+const Channel = ({ channel, episode, onEditRestream }) => { + const { user } = useUser(); + + return
+ {onEditRestream && mayEditRestream(user, episode, channel) ? + + : null}
; +}; Channel.propTypes = { channel: PropTypes.shape({ @@ -25,6 +39,9 @@ Channel.propTypes = { stream_link: PropTypes.string, title: PropTypes.string, }), + episode: PropTypes.shape({ + }), + onEditRestream: PropTypes.func, }; export default Channel;