]> git.localhorst.tv Git - alttp.git/blob - resources/js/components/episodes/MultiLink.js
tracker medallion controler
[alttp.git] / resources / js / components / episodes / MultiLink.js
1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Button } from 'react-bootstrap';
4
5 import Icon from '../common/Icon';
6 import { getStreamLink } from '../../helpers/Crew';
7
8 const MultiLink = ({ players }) => {
9         const streams = players.map(getStreamLink);
10         const names = streams.map(s => s.split('/').pop());
11         const url = `https://multistre.am/${names.join('/')}`;
12
13         return <div className="episode-channel">
14                 <Button
15                         href={url}
16                         rel="noreferer"
17                         target="_blank"
18                         title="MultiTwitch"
19                         variant="outline-twitch"
20                 >
21                         <Icon.STREAM />
22                         {' MultiStream'}
23                 </Button>
24         </div>;
25 };
26
27 MultiLink.propTypes = {
28         players: PropTypes.arrayOf(PropTypes.shape({
29                 short_name: PropTypes.string,
30                 stream_link: PropTypes.string,
31                 title: PropTypes.string,
32         })),
33 };
34
35 export default MultiLink;