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

35 lines
949 B
React
Raw Permalink 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,
2020-01-29 16:26:39 +01:00
small: boolean,
2019-06-11 20:10:58 +02:00
};
export default function FileProperties(props: Props) {
2020-05-21 17:38:28 +02:00
const { uri, downloaded, claimIsMine, 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} />}
2020-05-21 17:38:28 +02:00
<FilePrice hideFree uri={uri} />
2019-06-11 20:10:58 +02:00
</div>
);
}