some-improvement
This commit is contained in:
@@ -75,7 +75,7 @@ export default function Credits() {
|
||||
<h3 className="text-sm font-medium text-gray-600 dark:text-gray-400">Current Balance</h3>
|
||||
</div>
|
||||
<div className="text-3xl font-bold text-gray-900 dark:text-white">
|
||||
{(balance.balance ?? 0).toLocaleString()}
|
||||
{(balance?.credits ?? 0).toLocaleString()}
|
||||
</div>
|
||||
<p className="text-sm text-gray-500 dark:text-gray-400 mt-2">Available credits</p>
|
||||
</Card>
|
||||
@@ -85,10 +85,10 @@ export default function Credits() {
|
||||
<h3 className="text-sm font-medium text-gray-600 dark:text-gray-400">Subscription Plan</h3>
|
||||
</div>
|
||||
<div className="text-3xl font-bold text-gray-900 dark:text-white">
|
||||
{balance.subscription_plan || 'None'}
|
||||
{(balance as any)?.subscription_plan || 'None'}
|
||||
</div>
|
||||
<p className="text-sm text-gray-500 dark:text-gray-400 mt-2">
|
||||
{balance.monthly_credits ? `${balance.monthly_credits.toLocaleString()} credits/month` : 'No subscription'}
|
||||
{(balance?.plan_credits_per_month ?? 0) ? `${(balance?.plan_credits_per_month ?? 0).toLocaleString()} credits/month` : 'No subscription'}
|
||||
</p>
|
||||
</Card>
|
||||
|
||||
@@ -97,13 +97,9 @@ export default function Credits() {
|
||||
<h3 className="text-sm font-medium text-gray-600 dark:text-gray-400">Status</h3>
|
||||
</div>
|
||||
<div className="mt-2">
|
||||
<Badge
|
||||
variant="light"
|
||||
color={balance.subscription_status === 'active' ? 'success' : 'secondary'}
|
||||
className="text-base font-semibold"
|
||||
>
|
||||
{balance.subscription_status || 'No subscription'}
|
||||
</Badge>
|
||||
<Badge variant="light" color={(balance as any)?.subscription_status === 'active' ? 'success' : 'secondary'} className="text-base font-semibold">
|
||||
{(balance as any)?.subscription_status || 'No subscription'}
|
||||
</Badge>
|
||||
</div>
|
||||
<p className="text-sm text-gray-500 dark:text-gray-400 mt-2">Subscription status</p>
|
||||
</Card>
|
||||
|
||||
@@ -69,7 +69,7 @@ export default function Usage() {
|
||||
<Card className="p-6">
|
||||
<h3 className="text-sm font-medium text-gray-600 dark:text-gray-400 mb-2">Current Balance</h3>
|
||||
<div className="text-3xl font-bold text-gray-900 dark:text-white">
|
||||
{balance.balance.toLocaleString()}
|
||||
{(balance?.credits ?? 0).toLocaleString()}
|
||||
</div>
|
||||
<p className="text-sm text-gray-500 dark:text-gray-400 mt-1">Available credits</p>
|
||||
</Card>
|
||||
@@ -77,22 +77,19 @@ export default function Usage() {
|
||||
<Card className="p-6">
|
||||
<h3 className="text-sm font-medium text-gray-600 dark:text-gray-400 mb-2">Monthly Allocation</h3>
|
||||
<div className="text-3xl font-bold text-gray-900 dark:text-white">
|
||||
{(balance.monthly_credits || 0).toLocaleString()}
|
||||
{(balance?.plan_credits_per_month ?? 0).toLocaleString()}
|
||||
</div>
|
||||
<p className="text-sm text-gray-500 dark:text-gray-400 mt-1">
|
||||
{balance.subscription_plan || 'No plan'}
|
||||
{ (balance as any)?.subscription_plan || 'No plan' }
|
||||
</p>
|
||||
</Card>
|
||||
|
||||
<Card className="p-6">
|
||||
<h3 className="text-sm font-medium text-gray-600 dark:text-gray-400 mb-2">Status</h3>
|
||||
<div className="mt-2">
|
||||
<Badge
|
||||
variant="light"
|
||||
className="text-lg"
|
||||
>
|
||||
{balance.subscription_status || 'No subscription'}
|
||||
</Badge>
|
||||
<Badge variant="light" className="text-lg">
|
||||
{(balance as any)?.subscription_status || 'No subscription'}
|
||||
</Badge>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user