From e011d0980319c7375eaa59f5318286c7327ef648 Mon Sep 17 00:00:00 2001 From: javayhu Date: Thu, 10 Jul 2025 10:54:07 +0800 Subject: [PATCH] feat: enhance CreditPackages component with loading indicator --- .../settings/credits/credit-packages.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/settings/credits/credit-packages.tsx b/src/components/settings/credits/credit-packages.tsx index d69c6aa..4d19bec 100644 --- a/src/components/settings/credits/credit-packages.tsx +++ b/src/components/settings/credits/credit-packages.tsx @@ -15,7 +15,7 @@ import { useLocaleRouter } from '@/i18n/navigation'; import { formatPrice } from '@/lib/formatter'; import { cn } from '@/lib/utils'; import { useTransactionStore } from '@/stores/transaction-store'; -import { CircleCheckBigIcon, CoinsIcon } from 'lucide-react'; +import { CircleCheckBigIcon, CoinsIcon, RefreshCwIcon } from 'lucide-react'; import { useTranslations } from 'next-intl'; import { useSearchParams } from 'next/navigation'; import { useEffect, useState } from 'react'; @@ -84,7 +84,7 @@ export function CreditPackages() { return (
- + {t('balance')} @@ -92,12 +92,14 @@ export function CreditPackages() {
- -
+ {/* */} +
{loadingCredits ? ( - ... + ) : ( - credits?.toLocaleString() || 0 +
+ {credits?.toLocaleString() || 0} +
)}