@@ -16,8 +16,8 @@ import {
1616} from '@/components/ui/dropdown-menu' ;
1717import { Plus , Check , X , User , ChevronDown , Star , Trash2 , Sparkles } from 'lucide-react' ;
1818import { CliproxyTable } from '@/components/cliproxy-table' ;
19- import { CliproxyDialog } from '@/components/cliproxy-dialog' ;
2019import { QuickSetupWizard } from '@/components/quick-setup-wizard' ;
20+ import { AddAccountDialog } from '@/components/add-account-dialog' ;
2121import {
2222 useCliproxy ,
2323 useCliproxyAuth ,
@@ -85,10 +85,12 @@ function ProviderRow({
8585 status,
8686 setDefaultMutation,
8787 removeMutation,
88+ onAddAccount,
8889} : {
8990 status : AuthStatus ;
9091 setDefaultMutation : ReturnType < typeof useSetDefaultAccount > ;
9192 removeMutation : ReturnType < typeof useRemoveAccount > ;
93+ onAddAccount : ( ) => void ;
9294} ) {
9395 const accounts = status . accounts || [ ] ;
9496
@@ -148,35 +150,22 @@ function ProviderRow({
148150 </ div >
149151
150152 < div className = "flex items-center gap-2" >
151- { ! status . authenticated && (
152- < div className = "text-xs font-mono bg-muted px-2 py-1 rounded text-muted-foreground select-all" >
153- ccs { status . provider } --auth
154- </ div >
155- ) }
156- { status . authenticated && (
157- < Button
158- variant = "outline"
159- size = "sm"
160- className = "h-7 text-xs gap-1"
161- onClick = { ( ) => {
162- // This is a placeholder since we can't actually run the auth command from UI easily without a terminal
163- // But we can show the command to run
164- navigator . clipboard . writeText ( `ccs ${ status . provider } --auth` ) ;
165- } }
166- title = "Copy auth command"
167- >
168- < Plus className = "w-3 h-3" />
169- Add Account
170- </ Button >
171- ) }
153+ { /* Show Add Account button for all - opens dialog with instructions */ }
154+ < Button variant = "outline" size = "sm" className = "h-7 text-xs gap-1" onClick = { onAddAccount } >
155+ < Plus className = "w-3 h-3" />
156+ Add Account
157+ </ Button >
172158 </ div >
173159 </ div >
174160 ) ;
175161}
176162
177163export function CliproxyPage ( ) {
178- const [ dialogOpen , setDialogOpen ] = useState ( false ) ;
179164 const [ wizardOpen , setWizardOpen ] = useState ( false ) ;
165+ const [ addAccountProvider , setAddAccountProvider ] = useState < {
166+ provider : string ;
167+ displayName : string ;
168+ } | null > ( null ) ;
180169 const { data, isLoading } = useCliproxy ( ) ;
181170 const { data : authData , isLoading : authLoading } = useCliproxyAuth ( ) ;
182171 const setDefaultMutation = useSetDefaultAccount ( ) ;
@@ -191,16 +180,10 @@ export function CliproxyPage() {
191180 Manage OAuth-based provider variants and multi-account configurations
192181 </ p >
193182 </ div >
194- < div className = "flex items-center gap-2" >
195- < Button variant = "outline" onClick = { ( ) => setWizardOpen ( true ) } >
196- < Sparkles className = "w-4 h-4 mr-2" />
197- Quick Setup
198- </ Button >
199- < Button onClick = { ( ) => setDialogOpen ( true ) } >
200- < Plus className = "w-4 h-4 mr-2" />
201- Create Variant
202- </ Button >
203- </ div >
183+ < Button onClick = { ( ) => setWizardOpen ( true ) } >
184+ < Sparkles className = "w-4 h-4 mr-2" />
185+ Quick Setup
186+ </ Button >
204187 </ div >
205188
206189 { /* Built-in Profiles with Account Management */ }
@@ -226,6 +209,12 @@ export function CliproxyPage() {
226209 status = { status }
227210 setDefaultMutation = { setDefaultMutation }
228211 removeMutation = { removeMutation }
212+ onAddAccount = { ( ) =>
213+ setAddAccountProvider ( {
214+ provider : status . provider ,
215+ displayName : status . displayName ,
216+ } )
217+ }
229218 />
230219 ) ) }
231220 </ div >
@@ -252,8 +241,13 @@ export function CliproxyPage() {
252241 ) }
253242 </ div >
254243
255- < CliproxyDialog open = { dialogOpen } onClose = { ( ) => setDialogOpen ( false ) } />
256244 < QuickSetupWizard open = { wizardOpen } onClose = { ( ) => setWizardOpen ( false ) } />
245+ < AddAccountDialog
246+ open = { addAccountProvider !== null }
247+ onClose = { ( ) => setAddAccountProvider ( null ) }
248+ provider = { addAccountProvider ?. provider || '' }
249+ displayName = { addAccountProvider ?. displayName || '' }
250+ />
257251 </ div >
258252 ) ;
259253}
0 commit comments