lbry-desktop/ui/component/livestreamLink/view.jsx
Dan Peterson 038692cafc
Feature livestream scheduling (#458)
Add livestream scheduling feature
Also supports back to back streams, and will notify on a non-active stream of an active one.
2021-12-16 16:59:13 -05:00

30 lines
766 B
JavaScript

// @flow
import React from 'react';
import Card from 'component/common/card';
import ClaimPreview from 'component/claimPreview';
import { useHistory } from 'react-router';
import { formatLbryUrlForWeb } from 'util/url';
type Props = {
claimUri: string,
};
export default function LivestreamLink(props: Props) {
const { claimUri } = props;
const { push } = useHistory();
const element = (props: { children: any }) => (
<Card
className="livestream__channel-link claim-preview__live"
title={__('Live stream in progress')}
onClick={() => {
push(formatLbryUrlForWeb(claimUri));
}}
>
{props.children}
</Card>
);
return claimUri && <ClaimPreview uri={claimUri} wrapperElement={element} type="inline" />;
}