Tweak zero remaining events copy
This commit is contained in:
@@ -262,6 +262,10 @@ function PackageCard({ pkg, label, isActive = false }: { pkg: TenantPackageSumma
|
||||
const { border, primary, accentSoft, textStrong, muted } = useAdminTheme();
|
||||
const limits = (pkg.package_limits ?? null) as Record<string, unknown> | null;
|
||||
const remaining = pkg.remaining_events ?? (limits?.max_events_per_year as number | undefined) ?? 0;
|
||||
const remainingText =
|
||||
remaining === 0
|
||||
? t('mobileBilling.remainingEventsZero', 'No events remaining')
|
||||
: t('mobileBilling.remainingEvents', '{{count}} events', { count: remaining });
|
||||
const expires = pkg.expires_at ? formatDate(pkg.expires_at) : null;
|
||||
const usageMetrics = buildPackageUsageMetrics(pkg);
|
||||
const limitEntries = getPackageLimitEntries(limits, t);
|
||||
@@ -290,9 +294,7 @@ function PackageCard({ pkg, label, isActive = false }: { pkg: TenantPackageSumma
|
||||
</Text>
|
||||
) : null}
|
||||
<XStack space="$2" marginTop="$2" flexWrap="wrap">
|
||||
<PillBadge tone="muted">
|
||||
{t('mobileBilling.remainingEvents', '{{count}} events', { count: remaining })}
|
||||
</PillBadge>
|
||||
<PillBadge tone="muted">{remainingText}</PillBadge>
|
||||
{pkg.price !== null && pkg.price !== undefined ? (
|
||||
<PillBadge tone="muted">{formatAmount(pkg.price, pkg.currency ?? 'EUR')}</PillBadge>
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user