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

43 lines
1.1 KiB
React
Raw Normal View History

2020-03-14 17:07:36 +01:00
// @flow
import { SIMPLE_SITE } from 'config';
2020-03-14 17:07:36 +01:00
import React from 'react';
import DateTime from 'component/dateTime';
import FileViewCount from 'component/fileViewCount';
import CreditAmount from 'component/common/credit-amount';
2020-09-30 22:46:20 +02:00
import FileActions from 'component/fileActions';
2020-03-14 17:07:36 +01:00
type Props = {
uri: string,
claim: StreamClaim,
pendingAmount: string,
2020-03-14 17:07:36 +01:00
};
function FileSubtitle(props: Props) {
2020-09-30 22:46:20 +02:00
const { uri, claim, pendingAmount } = props;
2020-03-14 17:07:36 +01:00
return (
<div className="media__subtitle--between">
2020-09-30 22:46:20 +02:00
<div className="file__viewdate">
<span>
<DateTime uri={uri} show={DateTime.SHOW_DATE} />
{!SIMPLE_SITE && (
<>
{' • ' /* this is bad, but it's quick! */}
<CreditAmount
amount={parseFloat(claim.amount) + parseFloat(pendingAmount || claim.meta.support_amount)}
precision={2}
/>
</>
)}
</span>
2020-03-14 17:07:36 +01:00
<FileViewCount uri={uri} />
2020-09-30 22:46:20 +02:00
</div>
<FileActions uri={uri} />
2020-03-14 17:07:36 +01:00
</div>
);
}
export default FileSubtitle;