import React from 'react'; class AssetInfo extends React.Component { constructor (props) { super(props); this.toggleSection = this.toggleSection.bind(this); this.copyToClipboard = this.copyToClipboard.bind(this); } toggleSection (event) { var dataSet = event.target.dataset; var status = dataSet.status; var toggle = document.getElementById('show-details-toggle'); var details = document.getElementById('show-details'); if (status === 'closed') { details.hidden = false; toggle.innerText = '[less]'; toggle.dataset.status = 'open'; } else { details.hidden = true; toggle.innerText = '[more]'; toggle.dataset.status = 'closed'; } } copyToClipboard (event) { var elementToCopy = event.target.dataset.elementtocopy; var element = document.getElementById(elementToCopy); element.select(); try { document.execCommand('copy'); } catch (err) { this.setState({error: 'Oops, unable to copy'}); } } render () { return (
{this.props.channelName &&
Channel:
{this.props.channelName}
} {this.props.description &&
{this.props.description}
}
Embed:
{(this.props.contentType === 'video/mp4') ? ( `}/> ) : ( `} /> )}
Share:
twitter facebook tumblr reddit
[more]
); } }; // required props // {channelName, certificateId, description, shortId, name, fileExt, claimId, contentType, thumbnail, host} export default AssetInfo;