website refactor

This commit is contained in:
2026-01-12 01:01:49 +01:00
parent 5ca6023a5a
commit fefd8d1cd6
294 changed files with 4628 additions and 4991 deletions

View File

@@ -1,47 +0,0 @@
import { usePageData, usePageMutation } from '@/lib/page/usePageData';
import { useInject } from '@/lib/di/hooks/useInject';
import { LEAGUE_WALLET_SERVICE_TOKEN } from '@/lib/di/tokens';
export function useLeagueWalletPageData(leagueId: string) {
const leagueWalletService = useInject(LEAGUE_WALLET_SERVICE_TOKEN);
const queryResult = usePageData({
queryKey: ['leagueWallet', leagueId],
queryFn: () => leagueWalletService.getWalletForLeague(leagueId),
enabled: !!leagueId,
});
return queryResult;
}
export function useLeagueWalletWithdrawal(leagueId: string, data: any, refetch: () => void) {
const leagueWalletService = useInject(LEAGUE_WALLET_SERVICE_TOKEN);
const withdrawMutation = usePageMutation(
async ({ amount }: { amount: number }) => {
if (!data) throw new Error('Wallet data not available');
const result = await leagueWalletService.withdraw(
leagueId,
amount,
data.currency,
'season-2', // Current active season
'bank-account-***1234'
);
if (!result.success) {
throw new Error(result.message || 'Withdrawal failed');
}
return result;
},
{
onSuccess: () => {
// Refetch wallet data after successful withdrawal
refetch();
},
}
);
return withdrawMutation;
}