import React from "react"; import lbryio from "lbryio"; import { BusyMessage, CreditAmount, Icon } from "component/common"; import SubHeader from "component/subHeader"; import Auth from "component/auth"; import Link from "component/link"; import RewardLink from "component/rewardLink"; const RewardTile = props => { const { reward } = props; const claimed = !!reward.transaction_id; return (

{reward.reward_title}

{claimed ? Reward claimed. : }
{reward.reward_description}
); }; const RewardsPage = props => { const { fetching, isEligible, isVerificationCandidate, hasEmail, rewards, } = props; let content, isCard = false; if (!hasEmail || isVerificationCandidate) { content = (

{__( "Additional information is required to be eligible for the rewards program." )}

); isCard = true; } else if (!isEligible) { isCard = true; content = (

{__("You are not eligible to claim rewards.")}

To become eligible, email {" "} with a link to a public social media profile.

); } else if (fetching) { content = ; } else if (rewards.length > 0) { content = rewards.map(reward => ); } else { content =
{__("Failed to load rewards.")}
; } return (
{isCard ?
{content}
: content}
); }; export default RewardsPage;