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 { withUser } from '../../helpers/UserContext';
9 const Channel = ({ channel, episode, onEditRestream, user }) =>
10 <div className="episode-channel text-nowrap">
12 href={channel.stream_link}
16 variant="outline-twitch"
20 {channel.short_name || channel.title}
22 {onEditRestream && mayEditRestream(user, episode, channel) ?
25 onClick={() => onEditRestream(episode, channel)}
26 variant="outline-secondary"
34 channel: PropTypes.shape({
35 short_name: PropTypes.string,
36 stream_link: PropTypes.string,
37 title: PropTypes.string,
39 episode: PropTypes.shape({
41 onEditRestream: PropTypes.func,
42 user: PropTypes.shape({
46 export default withUser(Channel);