diff --git a/web/app/(app)/dashboard/(components)/account-settings.tsx b/web/app/(app)/dashboard/(components)/account-settings.tsx index faa968b..16590a6 100644 --- a/web/app/(app)/dashboard/(components)/account-settings.tsx +++ b/web/app/(app)/dashboard/(components)/account-settings.tsx @@ -229,16 +229,44 @@ export default function AccountSettings() {
) + // Format price with currency symbol + const formatPrice = (amount: number | null | undefined, currency: string | null | undefined) => { + if (amount == null || currency == null) return 'Free'; + + const formatter = new Intl.NumberFormat('en-US', { + style: 'currency', + currency: currency.toUpperCase() || 'USD', + minimumFractionDigits: 2, + }); + + return formatter.format(amount / 100); + }; + + const getBillingInterval = (interval: string | null | undefined) => { + if (!interval) return ''; + return interval.toLowerCase() === 'month' ? 'monthly' : 'yearly'; + }; + return (- Current subscription -
++ Current subscription +
+ {currentSubscription?.amount > 0 && ( +
{currentSubscription?.plan?.dailyLimit === -1
? 'Unlimited'
- : currentSubscription?.plan?.dailyLimit}
+ : currentSubscription?.plan?.dailyLimit || '0'}
{currentSubscription?.plan?.dailyLimit === -1 && (
{currentSubscription?.plan?.monthlyLimit === -1
? 'Unlimited'
- : currentSubscription?.plan?.monthlyLimit?.toLocaleString()}
+ : currentSubscription?.plan?.monthlyLimit?.toLocaleString() || '0'}
{currentSubscription?.plan?.monthlyLimit === -1 && (
{currentSubscription?.plan?.bulkSendLimit === -1
? 'Unlimited'
- : currentSubscription?.plan?.bulkSendLimit}
+ : currentSubscription?.plan?.bulkSendLimit || '0'}
{currentSubscription?.plan?.bulkSendLimit === -1 && (