2019-06-11 20:10:58 +02:00
|
|
|
// @flow
|
2020-05-11 17:54:39 +02:00
|
|
|
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 (
|
2020-05-11 17:54:39 +02:00
|
|
|
<div
|
|
|
|
className={classnames('file-properties', {
|
|
|
|
'file-properties--small': small,
|
|
|
|
})}
|
|
|
|
>
|
2019-12-19 06:39:20 +01:00
|
|
|
<VideoDuration uri={uri} />
|
2020-01-28 20:52:17 +01:00
|
|
|
<FileType uri={uri} />
|
2020-05-11 17:54:39 +02:00
|
|
|
{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>
|
|
|
|
);
|
|
|
|
}
|