11import { CHATGPT_OAUTH_ENABLED } from '@codebuff/common/constants/chatgpt-oauth'
2- import { CLAUDE_OAUTH_ENABLED } from '@codebuff/common/constants/claude-oauth'
32import { IS_FREEBUFF } from '../utils/constants'
4- import { isChatGptOAuthValid , isClaudeOAuthValid } from '@codebuff/sdk'
3+ import { isChatGptOAuthValid } from '@codebuff/sdk'
54import { TextAttributes } from '@opentui/core'
65import { safeOpen } from '../utils/open-url'
76import React , { useEffect , useMemo } from 'react'
@@ -10,7 +9,6 @@ import { BottomBanner } from './bottom-banner'
109import { Button } from './button'
1110import { ProgressBar } from './progress-bar'
1211import { getActivityQueryData } from '../hooks/use-activity-query'
13- import { useClaudeQuotaQuery } from '../hooks/use-claude-quota-query'
1412import { useSubscriptionQuery } from '../hooks/use-subscription-query'
1513import { useTheme } from '../hooks/use-theme'
1614import { useUpdatePreference } from '../hooks/use-update-preference'
@@ -52,16 +50,9 @@ export const UsageBanner = ({ showTime }: { showTime: number }) => {
5250 const sessionCreditsUsed = useChatStore ( ( state ) => state . sessionCreditsUsed )
5351 const setInputMode = useChatStore ( ( state ) => state . setInputMode )
5452
55- // Check if Claude OAuth is connected (only when feature is enabled)
56- const isClaudeConnected = CLAUDE_OAUTH_ENABLED && isClaudeOAuthValid ( )
53+ // Check if ChatGPT OAuth is connected
5754 const isChatGptConnected = CHATGPT_OAUTH_ENABLED && isChatGptOAuthValid ( )
5855
59- // Fetch Claude quota data if connected
60- const { data : claudeQuota , isLoading : isClaudeLoading } = useClaudeQuotaQuery ( {
61- enabled : isClaudeConnected ,
62- refetchInterval : 30 * 1000 , // Refresh every 30 seconds when banner is open
63- } )
64-
6556 // Fetch subscription data
6657 const { data : subscriptionData , isLoading : isSubscriptionLoading } = useSubscriptionQuery ( {
6758 refetchInterval : 30 * 1000 ,
@@ -164,40 +155,6 @@ export const UsageBanner = ({ showTime }: { showTime: number }) => {
164155 </ box >
165156 </ Button >
166157
167- { /* Claude subscription section - only show if connected */ }
168- { isClaudeConnected && (
169- < box style = { { flexDirection : 'column' , marginTop : 1 } } >
170- < text style = { { fg : theme . muted } } > Claude subscription</ text >
171- { isClaudeLoading ? (
172- < text style = { { fg : theme . muted } } > Loading quota...</ text >
173- ) : claudeQuota ? (
174- < box style = { { flexDirection : 'column' , gap : 0 } } >
175- < box style = { { flexDirection : 'row' , alignItems : 'center' , gap : 1 } } >
176- < text style = { { fg : theme . muted } } > 5-hour:</ text >
177- < ProgressBar value = { claudeQuota . fiveHourRemaining } width = { 15 } />
178- { claudeQuota . fiveHourResetsAt && (
179- < text style = { { fg : theme . muted } } >
180- (resets in { formatResetTime ( claudeQuota . fiveHourResetsAt ) } )
181- </ text >
182- ) }
183- </ box >
184- { /* Only show 7-day bar if the user has a 7-day limit */ }
185- { claudeQuota . sevenDayResetsAt && (
186- < box style = { { flexDirection : 'row' , alignItems : 'center' , gap : 1 } } >
187- < text style = { { fg : theme . muted } } > 7-day: </ text >
188- < ProgressBar value = { claudeQuota . sevenDayRemaining } width = { 15 } />
189- < text style = { { fg : theme . muted } } >
190- (resets in { formatResetTime ( claudeQuota . sevenDayResetsAt ) } )
191- </ text >
192- </ box >
193- ) }
194- </ box >
195- ) : (
196- < text style = { { fg : theme . muted } } > Unable to fetch quota</ text >
197- ) }
198- </ box >
199- ) }
200-
201158 { isChatGptConnected && (
202159 < box style = { { flexDirection : 'column' , marginTop : 1 } } >
203160 < text style = { { fg : theme . muted } } > ChatGPT subscription</ text >
0 commit comments