import React from 'react'; import { View, Text, StyleSheet } from 'react-native'; import { GradientCard } from './GradientCard'; import { useTheme } from '../theme/context'; import type { PointBalance } from '../types'; interface PointsBalanceProps { balances: PointBalance[]; style?: object; } export function PointsBalance({ balances, style }: PointsBalanceProps) { const theme = useTheme(); // Find primary and secondary currencies const primary = balances.find((b) => b.currency === 'qwik-coins') || balances[0]; const secondary = balances.find((b) => b.currency !== primary?.currency); const formattedBalance = primary?.balance.toLocaleString() || '0'; const secondaryBalance = secondary ? `${secondary.balance.toLocaleString()} ${secondary.currency}` : null; return ( CURRENT BALANCE QwikCard $ {formattedBalance} {secondaryBalance && ( + {secondaryBalance} )} ); } const styles = StyleSheet.create({ card: { padding: 20, minHeight: 150, justifyContent: 'space-between', }, header: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginBottom: 16, }, label: { color: 'rgba(255, 255, 255, 0.8)', fontSize: 10, fontWeight: '700', letterSpacing: 1.2, }, brand: { color: '#FFFFFF', fontSize: 12, fontWeight: '800', fontStyle: 'italic', }, mainContent: { flexDirection: 'row', alignItems: 'flex-start', }, currencySymbol: { color: 'rgba(255, 255, 255, 0.9)', fontSize: 20, fontWeight: '600', marginTop: 2, marginRight: 4, }, amount: { color: '#FFFFFF', fontSize: 32, fontWeight: '800', letterSpacing: -0.5, }, footer: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginTop: 16, }, chip: { backgroundColor: 'rgba(255, 255, 255, 0.2)', paddingHorizontal: 10, paddingVertical: 4, borderRadius: 16, }, chipText: { color: '#FFFFFF', fontSize: 11, fontWeight: '600', }, dots: { flexDirection: 'row', gap: 5, }, dot: { width: 20, height: 20, borderRadius: 10, opacity: 0.8, }, }); export default PointsBalance;