@@ -7,6 +7,11 @@ import { useAppStore } from '../../store'
77import { Button } from '../ui/button'
88import { Badge } from '../ui/badge'
99import type { CursorAccountStatus } from '../../../../shared/rate-limit-types'
10+ import {
11+ CURSOR_MODELS_BUCKET_NAME ,
12+ ON_DEMAND_BUCKET_NAME ,
13+ OTHER_MODELS_BUCKET_NAME
14+ } from '../../../../shared/cursor-usage-buckets'
1015import { SearchableSetting } from './SearchableSetting'
1116
1217const CURSOR_DOCS_URL = 'https://cursor.com/docs'
@@ -52,10 +57,18 @@ export function CursorAccountsSection(): React.JSX.Element {
5257
5358 const signedIn = status ?. signedIn === true
5459 const tokenFresh = status ?. tokenFresh === true
55- const usageWindow = cursorUsage ?. monthly ?? null
56- const autoBucket = cursorUsage ?. buckets ?. find ( ( b ) => b . name === 'Auto' )
57- const apiBucket = cursorUsage ?. buckets ?. find ( ( b ) => b . name === 'API' )
58- const onDemandBucket = cursorUsage ?. buckets ?. find ( ( b ) => b . name === 'On-demand' )
60+ const cursorModelsBucket = cursorUsage ?. buckets ?. find (
61+ ( bucket ) => bucket . name === CURSOR_MODELS_BUCKET_NAME
62+ )
63+ const otherModelsBucket = cursorUsage ?. buckets ?. find (
64+ ( bucket ) => bucket . name === OTHER_MODELS_BUCKET_NAME
65+ )
66+ const onDemandBucket = cursorUsage ?. buckets ?. find (
67+ ( bucket ) => bucket . name === ON_DEMAND_BUCKET_NAME
68+ )
69+ const billingReset = cursorUsage ?. buckets ?. find (
70+ ( bucket ) => bucket . resetDescription
71+ ) ?. resetDescription
5972
6073 return (
6174 < section id = "accounts-cursor" className = "space-y-4 scroll-mt-6" >
@@ -155,43 +168,34 @@ export function CursorAccountsSection(): React.JSX.Element {
155168 </ Button >
156169 </ div >
157170
158- { usageWindow || autoBucket || apiBucket || onDemandBucket ? (
171+ { cursorModelsBucket || otherModelsBucket || onDemandBucket ? (
159172 < SearchableSetting
160173 title = { translate (
161174 'auto.components.settings.CursorAccountsSection.a8f3e2c1b4' ,
162175 'Plan usage'
163176 ) }
164177 description = { translate (
165178 'auto.components.settings.CursorAccountsSection.b7e2d9f0a3' ,
166- 'Same plan, Auto, API , and on-demand usage as the Cursor dashboard.'
179+ 'Cursor Models, Other Models , and on-demand usage from the Cursor dashboard.'
167180 ) }
168- keywords = { [ 'cursor' , 'usage' , 'subscription' , 'plan' , 'auto ' , 'api ' ] }
181+ keywords = { [ 'cursor' , 'usage' , 'subscription' , 'plan' , 'models ' , 'on-demand ' ] }
169182 >
170183 < div className = "flex flex-wrap items-center gap-2 text-xs" >
171- { usageWindow ? (
172- < Badge variant = "secondary" className = "tabular-nums" >
173- { translate (
174- 'auto.components.settings.CursorAccountsSection.d5e0b7c3a1' ,
175- 'Plan {{pct}}%' ,
176- { pct : String ( Math . round ( usageWindow . usedPercent ) ) }
177- ) }
178- </ Badge >
179- ) : null }
180- { autoBucket ? (
184+ { cursorModelsBucket ? (
181185 < Badge variant = "secondary" className = "tabular-nums" >
182186 { translate (
183187 'auto.components.settings.CursorAccountsSection.e4f1c8d2b0' ,
184- 'Auto {{pct}}%' ,
185- { pct : String ( Math . round ( autoBucket . usedPercent ) ) }
188+ 'Cursor Models {{pct}}%' ,
189+ { pct : String ( Math . round ( cursorModelsBucket . usedPercent ) ) }
186190 ) }
187191 </ Badge >
188192 ) : null }
189- { apiBucket ? (
193+ { otherModelsBucket ? (
190194 < Badge variant = "secondary" className = "tabular-nums" >
191195 { translate (
192196 'auto.components.settings.CursorAccountsSection.f3a2d9e1c7' ,
193- 'API {{pct}}%' ,
194- { pct : String ( Math . round ( apiBucket . usedPercent ) ) }
197+ 'Other Models {{pct}}%' ,
198+ { pct : String ( Math . round ( otherModelsBucket . usedPercent ) ) }
195199 ) }
196200 </ Badge >
197201 ) : null }
@@ -204,12 +208,12 @@ export function CursorAccountsSection(): React.JSX.Element {
204208 ) }
205209 </ Badge >
206210 ) : null }
207- { usageWindow ?. resetDescription ? (
211+ { billingReset ? (
208212 < span className = "text-muted-foreground" >
209213 { translate (
210214 'auto.components.settings.CursorAccountsSection.c6d1a8f4e2' ,
211215 'Resets {{when}}' ,
212- { when : usageWindow . resetDescription }
216+ { when : billingReset }
213217 ) }
214218 </ span >
215219 ) : null }
0 commit comments