import { Share2 } from 'lucide-react' import { useTranslation } from 'react-i18next' import { formatQuota } from '@/lib/format' import { Button } from '@/components/ui/button' import { Card, CardContent } from '@/components/ui/card' import { Input } from '@/components/ui/input' import { Skeleton } from '@/components/ui/skeleton' import { CopyButton } from '@/components/copy-button' import type { UserWalletData } from '../types' interface AffiliateRewardsCardProps { user: UserWalletData | null affiliateLink: string onTransfer: () => void loading?: boolean } export function AffiliateRewardsCard({ user, affiliateLink, onTransfer, loading, }: AffiliateRewardsCardProps) { const { t } = useTranslation() if (loading) { return ( ) } const hasRewards = (user?.aff_quota ?? 0) > 0 return ( {t('Referral Program')} {t( 'Earn rewards when your referrals add funds. Transfer accumulated rewards to your balance anytime.' )} {[ [t('Pending'), formatQuota(user?.aff_quota ?? 0)], [t('Total Earned'), formatQuota(user?.aff_history_quota ?? 0)], [t('Invites'), String(user?.aff_count ?? 0)], ].map(([label, value]) => ( {label} {value} ))} {hasRewards && ( {t('Transfer to Balance')} )} ) }
{t( 'Earn rewards when your referrals add funds. Transfer accumulated rewards to your balance anytime.' )}