// @flow import * as React from 'react'; import Button from 'component/button'; import CreditAmount from 'component/common/credit-amount'; import BusyIndicator from 'component/common/busy-indicator'; type Props = { unclaimedRewardAmount: number, fetching: boolean, fetchRewards: () => void, fetchRewardedContent: () => void, }; class RewardSummary extends React.Component { componentDidMount() { this.props.fetchRewards(); this.props.fetchRewardedContent(); } render() { const { unclaimedRewardAmount, fetching } = this.props; const hasRewards = unclaimedRewardAmount > 0; return (
{__('Rewards')} {fetching && }

{!fetching && (hasRewards ? ( {__('You have')}     {__('in unclaimed rewards')}. ) : ( {__('There are no rewards available at this time, please check back later')}. ))}

{__('Read our')}{' '}

); } } export default RewardSummary;