1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Button } from 'react-bootstrap';
5 import Icon from '../common/Icon';
6 import { mayEditRestream } from '../../helpers/permissions';
7 import { useUser } from '../../hooks/user';
9 const Channel = ({ channel, episode, onEditRestream }) => {
10 const { user } = useUser();
12 return <div className="episode-channel text-nowrap">
14 href={channel.stream_link}
18 variant="outline-twitch"
22 {channel.short_name || channel.title}
24 {onEditRestream && mayEditRestream(user, episode, channel) ?
27 onClick={() => onEditRestream(episode, channel)}
28 variant="outline-secondary"
37 channel: PropTypes.shape({
38 short_name: PropTypes.string,
39 stream_link: PropTypes.string,
40 title: PropTypes.string,
42 episode: PropTypes.shape({
44 onEditRestream: PropTypes.func,
47 export default Channel;