// @flow import React from 'react'; import RewardLink from 'component/rewardLink'; import Icon from 'component/common/icon'; import * as ICONS from 'constants/icons'; import Card from 'component/common/card'; import LbcMessage from 'component/common/lbc-message'; type Props = { invitees: ?Array<{ email: string, invite_accepted: boolean, invite_reward_claimed: boolean, invite_reward_claimable: boolean, }>, referralReward: ?Reward, }; class InviteList extends React.PureComponent { render() { const { invitees, referralReward } = this.props; if (!invitees || !invitees.length) { return null; } let rewardAmount = 0; let rewardHelp = __( "Woah, you have a lot of friends! You've claimed the maximum amount of invite rewards. Email %email% if you'd like to be whitelisted for more invites.", { email: 'hello@odysee.com' } ); if (referralReward) { rewardAmount = referralReward.reward_amount; rewardHelp = referralReward.reward_description; } const showClaimable = invitees.some((invite) => invite.invite_reward_claimable && !invite.invite_reward_claimed); return ( {__('Invite History')}} subtitle={
{rewardHelp}
} titleActions={ referralReward && showClaimable && (
) } isBodyList body={
{invitees.map((invitee) => ( ))}
{__('Invitee Email')} {__('Invite Status')} {__('Reward')}
{invitee.email} {invitee.invite_accepted ? __('Accepted') : __('Not Accepted')} {invitee.invite_reward_claimed && ( {__('Claimed')} )} {!invitee.invite_reward_claimed && (invitee.invite_reward_claimable ? {__('Claimable')} : __('Unclaimable'))}
} /> ); } } export default InviteList;