import React from 'react';
import lbry from 'lbry.js';
import lighthouse from 'lighthouse.js';
import lbryuri from 'lbryuri.js';
import Video from 'component/video'
import {
TruncatedText,
Thumbnail,
BusyMessage,
} from 'component/common';
import FilePrice from 'component/filePrice'
import FileActions from 'component/fileActions';
import Link from 'component/link';
import UriIndicator from 'component/uriIndicator';
const FormatItem = (props) => {
const {
contentType,
metadata: {
author,
language,
license,
}
} = props
const mediaType = lbry.getMediaType(contentType);
return (
Content-Type | {mediaType} |
Author | {author} |
Language | {language} |
License | {license} |
)
}
const FilePage = (props) => {
const {
claim,
navigate,
claim: {
txid,
nout,
has_signature: hasSignature,
signature_is_valid: signatureIsValid,
value,
value: {
stream,
stream: {
metadata,
source,
metadata: {
title,
} = {},
source: {
contentType,
} = {},
} = {},
} = {},
},
uri,
isDownloaded,
fileInfo,
costInfo,
costInfo: {
cost,
includesData: costIncludesData,
} = {},
} = props
const outpoint = txid + ':' + nout;
const uriLookupComplete = !!claim && Object.keys(claim).length
const channelUriObj = lbryuri.parse(uri)
delete channelUriObj.path;
delete channelUriObj.contentName;
const channelUri = signatureIsValid && hasSignature && channelUriObj.isChannel ? lbryuri.build(channelUriObj, false) : null;
const uriIndicator =
return (
{ contentType && contentType.startsWith('video/') ?
:
(Object.keys(metadata).length > 0 ? : ) }
{isDownloaded === false
?
: null}
{title}
{ channelUri ?
{uriIndicator} :
uriIndicator}
{metadata.description}
{ metadata ?
: '' }
)
}
export default FilePage;