chore: initial public snapshot for github upload

This commit is contained in:
Your Name
2026-03-26 20:06:14 +08:00
commit 0e5ecd930e
3497 changed files with 1586236 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
export function normalizeUsageServiceTier(serviceTier?: string | null): string | null {
const value = serviceTier?.trim().toLowerCase()
if (!value) return null
if (value === 'fast') return 'priority'
if (value === 'default' || value === 'standard') return 'standard'
if (value === 'priority' || value === 'flex') return value
return value
}
export function formatUsageServiceTier(serviceTier?: string | null): string {
const normalized = normalizeUsageServiceTier(serviceTier)
if (!normalized) return 'standard'
return normalized
}
export function getUsageServiceTierLabel(
serviceTier: string | null | undefined,
translate: (key: string) => string,
): string {
const tier = formatUsageServiceTier(serviceTier)
if (tier === 'priority') return translate('usage.serviceTierPriority')
if (tier === 'flex') return translate('usage.serviceTierFlex')
if (tier === 'standard') return translate('usage.serviceTierStandard')
return tier
}