import React from 'react';
import lbry from 'lbry';
import lbryuri from 'lbryuri';
import {Icon,} from 'component/common';
import FilePrice from 'component/filePrice'
import {Modal} from 'component/modal';
import {FormField} from 'component/form';
import Link from 'component/link';
import {ToolTip} from 'component/tooltip';
import {DropDownMenu, DropDownMenuItem} from 'component/menu';
class FileActionsRow extends React.Component {
constructor(props) {
super(props)
this.state = {
deleteChecked: false,
}
}
handleDeleteCheckboxClicked(event) {
this.setState({
deleteChecked: event.target.checked,
})
}
onAffirmPurchase() {
this.props.closeModal()
this.props.loadVideo()
}
render() {
const {
fileInfo,
platform,
downloading,
loading,
uri,
deleteFile,
openInFolder,
openInShell,
modal,
openModal,
affirmPurchase,
closeModal,
downloadClick,
} = this.props
const {
deleteChecked,
} = this.state
const metadata = fileInfo ? fileInfo.metadata : null
if (!fileInfo)
{
return null;
}
const openInFolderMessage = platform.startsWith('Mac') ? 'Open in Finder' : 'Open in Folder',
showMenu = Object.keys(fileInfo).length != 0;
let linkBlock;
if (Object.keys(fileInfo).length == 0 && !downloading && !loading) {
linkBlock = ;
} else if (downloading || loading) {
const
progress = (fileInfo && fileInfo.written_bytes) ? fileInfo.written_bytes / fileInfo.total_bytes * 100 : 0,
label = fileInfo ? progress.toFixed(0) + '% complete' : 'Connecting...',
labelWithIcon =
Are you sure you'd like to remove {title} from LBRY?