fix: unify tier color mapping, fix feature badge colors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
import { useAuth } from '../auth/useAuth';
|
||||
import { useLicense } from '../api/hooks';
|
||||
import styles from '../styles/platform.module.css';
|
||||
import { tierColor } from '../utils/tier';
|
||||
|
||||
const FEATURE_LABELS: Record<string, string> = {
|
||||
topology: 'Topology',
|
||||
@@ -23,16 +24,6 @@ const LIMIT_LABELS: Record<string, string> = {
|
||||
max_environments: 'Max Environments',
|
||||
};
|
||||
|
||||
function tierColor(tier: string): 'primary' | 'success' | 'warning' | 'error' {
|
||||
switch (tier?.toUpperCase()) {
|
||||
case 'BUSINESS': return 'success';
|
||||
case 'HIGH': return 'primary';
|
||||
case 'MID': return 'warning';
|
||||
case 'LOW': return 'error';
|
||||
default: return 'primary';
|
||||
}
|
||||
}
|
||||
|
||||
function daysRemaining(expiresAt: string): number {
|
||||
const now = Date.now();
|
||||
const exp = new Date(expiresAt).getTime();
|
||||
@@ -127,7 +118,7 @@ export function LicensePage() {
|
||||
<span className={styles.kvLabel}>{label}</span>
|
||||
<Badge
|
||||
label={enabled ? 'Enabled' : 'Not included'}
|
||||
color={enabled ? 'success' : 'auto'}
|
||||
color={enabled ? 'success' : 'warning'}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user