2020-04-01 20:43:50 +02:00
|
|
|
// @flow
|
|
|
|
import * as React from 'react';
|
|
|
|
import Button from 'component/button';
|
|
|
|
import I18nMessage from 'component/i18nMessage';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
uri: string,
|
|
|
|
fileInfo: FileListItem,
|
|
|
|
isInsufficientCredits: boolean,
|
2020-06-02 11:14:22 +02:00
|
|
|
claimWasPurchased: boolean,
|
2020-04-01 20:43:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
function ClaimInsufficientCredits(props: Props) {
|
2020-05-21 17:38:28 +02:00
|
|
|
const { isInsufficientCredits, fileInfo, claimWasPurchased } = props;
|
2020-04-01 20:43:50 +02:00
|
|
|
|
2020-05-21 17:38:28 +02:00
|
|
|
if (fileInfo || !isInsufficientCredits || claimWasPurchased) {
|
2020-04-01 20:43:50 +02:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="media__insufficient-credits help--warning">
|
|
|
|
<I18nMessage
|
|
|
|
tokens={{
|
|
|
|
reward_link: <Button button="link" navigate="/$/rewards" label={__('Rewards')} />,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
The publisher has chosen to charge LBC to view this content. Your balance is currently too low to view it. Check
|
|
|
|
out %reward_link% for free LBC or send more LBC to your wallet.
|
|
|
|
</I18nMessage>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ClaimInsufficientCredits;
|