@@ -22,7 +22,7 @@ const PLAN_NAMES = {
2222} as const
2323
2424interface UsageIndicatorProps {
25- onClick ?: ( badgeType : 'add' | 'upgrade' ) => void
25+ onClick ?: ( ) => void
2626}
2727
2828export function UsageIndicator ( { onClick } : UsageIndicatorProps ) {
@@ -39,7 +39,7 @@ export function UsageIndicator({ onClick }: UsageIndicatorProps) {
3939 // Show skeleton while loading
4040 if ( isLoading ) {
4141 return (
42- < div className = { CONTAINER_STYLES } onClick = { ( ) => onClick ?.( 'upgrade' ) } >
42+ < div className = { CONTAINER_STYLES } onClick = { ( ) => onClick ?.( ) } >
4343 < div className = 'space-y-2' >
4444 { /* Plan and usage info skeleton */ }
4545 < div className = 'flex items-center justify-between' >
@@ -69,13 +69,10 @@ export function UsageIndicator({ onClick }: UsageIndicatorProps) {
6969 // Determine badge to show
7070 const billingStatus = useSubscriptionStore . getState ( ) . getBillingStatus ( )
7171 const isBlocked = billingStatus === 'blocked'
72- const showAddBadge =
73- ! isBlocked && planType !== 'free' && planType !== 'enterprise' && usage . percentUsed >= 50
74- const badgeText = isBlocked ? 'Payment Failed' : planType === 'free' ? 'Upgrade' : 'Add'
75- const badgeType = isBlocked ? 'upgrade' : planType === 'free' ? 'upgrade' : 'add'
72+ const badgeText = isBlocked ? 'Payment Failed' : planType === 'free' ? 'Upgrade' : undefined
7673
7774 return (
78- < div className = { CONTAINER_STYLES } onClick = { ( ) => onClick ?.( badgeType ) } >
75+ < div className = { CONTAINER_STYLES } onClick = { ( ) => onClick ?.( ) } >
7976 < div className = 'space-y-2' >
8077 { /* Plan and usage info */ }
8178 < div className = 'flex items-center justify-between' >
@@ -88,9 +85,7 @@ export function UsageIndicator({ onClick }: UsageIndicatorProps) {
8885 >
8986 { PLAN_NAMES [ planType ] }
9087 </ span >
91- { ( showAddBadge || planType === 'free' ) && (
92- < Badge className = { GRADIENT_BADGE_STYLES } > { badgeText } </ Badge >
93- ) }
88+ { badgeText ? < Badge className = { GRADIENT_BADGE_STYLES } > { badgeText } </ Badge > : null }
9489 </ div >
9590 < span className = 'text-muted-foreground text-xs tabular-nums' >
9691 { isBlocked ? 'Payment required' : `$${ usage . current . toFixed ( 2 ) } / $${ usage . limit } ` }
0 commit comments