lbry-desktop/src/ui/component/fileProperties/view.jsx

33 lines
1 KiB
React
Raw Normal View History

2019-06-11 20:10:58 +02:00
// @flow
import * as icons from 'constants/icons';
import * as React from 'react';
import { parseURI } from 'lbry-redux';
import Icon from 'component/common/icon';
import FilePrice from 'component/filePrice';
2019-06-27 22:27:38 +02:00
import VideoDuration from 'component/videoDuration';
2019-06-11 20:10:58 +02:00
type Props = {
uri: string,
downloaded: boolean,
claimIsMine: boolean,
isSubscribed: boolean,
isNew: boolean,
rewardedContentClaimIds: Array<string>,
};
export default function FileProperties(props: Props) {
2019-06-27 22:27:38 +02:00
const { uri, downloaded, claimIsMine, rewardedContentClaimIds, isSubscribed } = props;
2019-06-11 20:10:58 +02:00
const { claimId } = parseURI(uri);
const isRewardContent = rewardedContentClaimIds.includes(claimId);
return (
<div className="file-properties">
{isSubscribed && <Icon tooltip icon={icons.SUBSCRIPTION} />}
{!claimIsMine && downloaded && <Icon tooltip icon={icons.DOWNLOAD} />}
{isRewardContent && <Icon tooltip icon={icons.FEATURED} />}
2019-06-11 20:10:58 +02:00
<FilePrice hideFree uri={uri} />
2019-06-27 22:27:38 +02:00
<VideoDuration className="media__subtitle" uri={uri} />
2019-06-11 20:10:58 +02:00
</div>
);
}