All files / src/features/wallet wallet-page.tsx

100% Statements 5/5
100% Branches 2/2
100% Functions 2/2
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41            2x 15x     15x 1x     15x                                                    
import { WalletCard } from './components/wallet-card';
import { Heading } from '@/components/heading';
import { FormMessage } from '@/components/form-message';
import { useWalletOperations } from './hooks/use-wallet';
import { WALLET_PAGE_HEADER } from '@/constants/wallet';
 
export const WalletPage = () => {
  const { error, refetch } = useWalletOperations();
 
  // Handle wallet data loading and error states
  const handleRetry = () => {
    refetch();
  };
 
  return (
    <div className="flex-1 p-6 md:p-8 lg:p-[85px] space-y-6">
      {/* Page Header */}
      <header className="space-y-2">
        <Heading as="h1" size="h3">
          {WALLET_PAGE_HEADER}
        </Heading>
        {error && (
          <FormMessage
            type="error"
            message={`Failed to load wallet data: ${error}`}
            onDismiss={handleRetry}
          />
        )}
      </header>
 
      {/* Wallet Card */}
      <WalletCard
        showWithdrawButton={true}
        className="shadow-lg hover:shadow-xl transition-shadow duration-300"
      />
    </div>
  );
};
 
export default WalletPage;