'use client'; import React, { useState } from 'react'; import { Card } from '@/ui/Card'; import { Button } from '@/ui/Button'; import { TransactionRow } from '@/components/leagues/TransactionRow'; import { LeagueWalletViewModel } from '@/lib/view-models/LeagueWalletViewModel'; import { Wallet, DollarSign, ArrowUpRight, Clock, AlertTriangle, Download, TrendingUp } from 'lucide-react'; interface WalletTemplateProps { data: LeagueWalletViewModel; onWithdraw?: (amount: number) => void; onExport?: () => void; mutationLoading?: boolean; } export function WalletTemplate({ data, onWithdraw, onExport, mutationLoading = false }: WalletTemplateProps) { const [withdrawAmount, setWithdrawAmount] = useState(''); const [showWithdrawModal, setShowWithdrawModal] = useState(false); const [filterType, setFilterType] = useState<'all' | 'sponsorship' | 'membership' | 'withdrawal' | 'prize'>('all'); const filteredTransactions = data.getFilteredTransactions(filterType); const handleWithdrawClick = () => { const amount = parseFloat(withdrawAmount); if (!amount || amount <= 0) return; if (onWithdraw) { onWithdraw(amount); setShowWithdrawModal(false); setWithdrawAmount(''); } }; return (
Manage your league's finances and payouts
{data.withdrawalBlockReason}
{filterType === 'all' ? 'Revenue from sponsorships and fees will appear here.' : `No ${filterType} transactions found.`}
Distributed after season completion to top 3 drivers
Available after Season 2 ends (estimated: Jan 15, 2026)
{data.withdrawalBlockReason}
Available: {data.formattedBalance}
Alpha Note: Wallet management is demonstration-only. Real payment processing and bank integrations will be available when the payment system is fully implemented. The 10% platform fee and season-based withdrawal restrictions are enforced in the actual implementation.