@@ -53,11 +53,12 @@ export const UsageRow = memo(function UsageRowComponent({
5353} : {
5454 feature : FeatureUsage ;
5555} ) {
56- const remainingPercent = feature . unlimited
57- ? 100
58- : Math . min ( Math . max ( ( feature . balance / feature . limit ) * 100 , 0 ) , 100 ) ;
56+ const used = feature . limit - feature . balance ;
57+ const usedPercent = feature . unlimited
58+ ? 0
59+ : Math . min ( Math . max ( ( used / feature . limit ) * 100 , 0 ) , 100 ) ;
5960 const hasNormalLimit = ! ( feature . unlimited || feature . hasExtraCredits ) ;
60- const isLow = hasNormalLimit && remainingPercent < 20 ;
61+ const isLow = hasNormalLimit && usedPercent > 80 ;
6162 const hasOverage = feature . overage !== null ;
6263
6364 const Icon = getFeatureIcon ( feature . name ) ;
@@ -110,9 +111,9 @@ export const UsageRow = memo(function UsageRowComponent({
110111 ) : feature . hasExtraCredits ? (
111112 < div className = "text-right" >
112113 < span className = "font-mono text-base" >
113- { formatCompactNumber ( feature . balance ) }
114+ { formatCompactNumber ( used ) }
114115 </ span >
115- < div className = "text-muted-foreground text-xs" > remaining </ div >
116+ < div className = "text-muted-foreground text-xs" > used </ div >
116117 </ div >
117118 ) : feature . overage ? (
118119 < div className = "text-right" >
@@ -131,10 +132,9 @@ export const UsageRow = memo(function UsageRowComponent({
131132 isLow ? "text-warning" : "text-foreground"
132133 ) }
133134 >
134- { formatCompactNumber ( feature . balance ) } /{ " " }
135- { formatCompactNumber ( feature . limit ) }
135+ { formatCompactNumber ( used ) } / { formatCompactNumber ( feature . limit ) }
136136 </ span >
137- < div className = "text-muted-foreground text-xs" > remaining </ div >
137+ < div className = "text-muted-foreground text-xs" > used </ div >
138138 </ div >
139139 ) }
140140 </ div >
@@ -151,7 +151,7 @@ export const UsageRow = memo(function UsageRowComponent({
151151 ? "bg-warning"
152152 : "bg-primary"
153153 ) }
154- style = { { width : hasOverage ? "100%" : `${ remainingPercent } %` } }
154+ style = { { width : hasOverage ? "100%" : `${ usedPercent } %` } }
155155 />
156156 </ div >
157157 { ( isLow || hasOverage ) && (
0 commit comments