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

42 lines
1.2 KiB
React
Raw Normal View History

2019-06-11 20:10:58 +02:00
// @flow
import * as ICONS from 'constants/icons';
2019-06-11 20:10:58 +02:00
import * as React from 'react';
2020-01-29 16:26:39 +01:00
import classnames from 'classnames';
2019-06-11 20:10:58 +02:00
import Icon from 'component/common/icon';
import FilePrice from 'component/filePrice';
2019-06-27 22:27:38 +02:00
import VideoDuration from 'component/videoDuration';
2020-01-28 20:52:17 +01:00
import FileType from 'component/fileType';
2019-06-11 20:10:58 +02:00
type Props = {
uri: string,
downloaded: boolean,
claimIsMine: boolean,
isSubscribed: boolean,
isNew: boolean,
2020-01-29 16:26:39 +01:00
small: boolean,
claimWasPurchased: boolean,
2019-06-11 20:10:58 +02:00
};
export default function FileProperties(props: Props) {
const { uri, downloaded, claimIsMine, claimWasPurchased, isSubscribed, small = false } = props;
2019-06-11 20:10:58 +02:00
return (
<div
className={classnames('file-properties', {
'file-properties--small': small,
})}
>
<VideoDuration uri={uri} />
2020-01-28 20:52:17 +01:00
<FileType uri={uri} />
{isSubscribed && <Icon tooltip icon={ICONS.SUBSCRIBE} />}
{!claimIsMine && downloaded && <Icon tooltip icon={ICONS.LIBRARY} />}
{claimWasPurchased ? (
<span className="file-properties__purchased">
<Icon icon={ICONS.PURCHASED} />
</span>
) : (
<FilePrice hideFree uri={uri} badge={false} className="file-properties__not-purchased" />
)}
2019-06-11 20:10:58 +02:00
</div>
);
}