2016-12-23 07:57:01 +01:00
|
|
|
import React from 'react';
|
2017-04-23 11:56:50 +02:00
|
|
|
import lbry from 'lbry.js';
|
|
|
|
import lbryuri from 'lbryuri.js';
|
2017-04-07 07:15:22 +02:00
|
|
|
import Link from 'component/link';
|
2017-04-23 16:01:00 +02:00
|
|
|
import FileCardStream from 'component/fileCardStream'
|
|
|
|
import FileTileStream from 'component/fileTileStream'
|
|
|
|
import FileActions from 'component/fileActions';
|
|
|
|
|
|
|
|
class FileTile extends React.Component {
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
displayStyle,
|
|
|
|
uri,
|
|
|
|
claim,
|
|
|
|
} = this.props
|
2017-04-26 19:08:26 +02:00
|
|
|
const resolvedUri = this.props.resolvedUris(uri) || {}
|
|
|
|
const claimInfo = resolvedUri.claim
|
|
|
|
|
2017-04-23 16:01:00 +02:00
|
|
|
if(!claim) {
|
|
|
|
if (displayStyle == 'card') {
|
|
|
|
return <FileCardStream uri={uri} />
|
2017-05-01 05:38:14 +02:00
|
|
|
}
|
2017-04-23 16:01:00 +02:00
|
|
|
return null
|
2017-01-13 04:23:12 +01:00
|
|
|
}
|
|
|
|
|
2017-04-23 16:01:00 +02:00
|
|
|
return displayStyle == 'card' ?
|
|
|
|
<FileCardStream uri={uri} />
|
|
|
|
:
|
|
|
|
<FileTileStream uri={uri} key={uri} />
|
2017-01-13 04:23:12 +01:00
|
|
|
}
|
2017-04-23 16:01:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export default FileTile
|