@@ -11,6 +11,7 @@ import { api, API_URL, ApiError } from '@/lib/api';
1111import { useAuth } from '@/lib/auth' ;
1212import { useT } from '@/lib/i18n' ;
1313import { prompt , toast } from '@/components/ui/overlays' ;
14+ import { Select } from '@/components/ui/Select' ;
1415
1516interface TwoFaStatus {
1617 enabled : boolean ;
@@ -75,6 +76,9 @@ export default function AccountPage() {
7576 void load ( ) . catch ( ( e ) => setError ( String ( e ) ) ) ;
7677 } , [ load ] ) ;
7778
79+ // Normal (non-vault) folders as dropdown options — vaults can't be API/quick/webhook targets.
80+ const folderOptions = folders . filter ( ( f ) => ! f . isZeroKnowledge ) . map ( ( f ) => ( { value : f . id , label : f . name } ) ) ;
81+
7882 async function wrap ( fn : ( ) => Promise < unknown > ) {
7983 setError ( null ) ;
8084 try {
@@ -257,20 +261,12 @@ export default function AccountPage() {
257261 value = { nc . code }
258262 onChange = { ( e ) => setNc ( { ...nc , code : e . target . value . toUpperCase ( ) } ) }
259263 />
260- < select
261- className = "input max- w-[14rem]"
264+ < Select
265+ className = "w-[14rem]"
262266 value = { nc . targetFolderId }
263- onChange = { ( e ) => setNc ( { ...nc , targetFolderId : e . target . value } ) }
264- >
265- < option value = "" > { t ( 'account.quickCodeDefaultFolder' ) } </ option >
266- { folders
267- . filter ( ( f ) => ! f . isZeroKnowledge )
268- . map ( ( f ) => (
269- < option key = { f . id } value = { f . id } >
270- { f . name }
271- </ option >
272- ) ) }
273- </ select >
267+ onChange = { ( v ) => setNc ( { ...nc , targetFolderId : v } ) }
268+ options = { [ { value : '' , label : t ( 'account.quickCodeDefaultFolder' ) } , ...folderOptions ] }
269+ />
274270 < input
275271 className = "input max-w-[9rem]"
276272 type = "number"
@@ -343,16 +339,12 @@ export default function AccountPage() {
343339 value = { nw . secret }
344340 onChange = { ( e ) => setNw ( { ...nw , secret : e . target . value } ) }
345341 />
346- < select className = "input max-w-[13rem]" value = { nw . folderId } onChange = { ( e ) => setNw ( { ...nw , folderId : e . target . value } ) } >
347- < option value = "" > { t ( 'account.webhookAnyFolder' ) } </ option >
348- { folders
349- . filter ( ( f ) => ! f . isZeroKnowledge )
350- . map ( ( f ) => (
351- < option key = { f . id } value = { f . id } >
352- { f . name }
353- </ option >
354- ) ) }
355- </ select >
342+ < Select
343+ className = "w-[13rem]"
344+ value = { nw . folderId }
345+ onChange = { ( v ) => setNw ( { ...nw , folderId : v } ) }
346+ options = { [ { value : '' , label : t ( 'account.webhookAnyFolder' ) } , ...folderOptions ] }
347+ />
356348 < button
357349 className = "btn-primary"
358350 disabled = { ! nw . url . trim ( ) }
@@ -430,29 +422,22 @@ export default function AccountPage() {
430422 value = { nt . name }
431423 onChange = { ( e ) => setNt ( { ...nt , name : e . target . value } ) }
432424 />
433- < select
434- className = "input max- w-[11rem ]"
425+ < Select
426+ className = "w-[12rem ]"
435427 value = { nt . scopes . join ( ',' ) }
436- onChange = { ( e ) => setNt ( { ...nt , scopes : e . target . value . split ( ',' ) as ( 'read' | 'write' ) [ ] } ) }
437- >
438- < option value = "write" > { t ( 'account.apiScopeWrite' ) } </ option >
439- < option value = "read" > { t ( 'account.apiScopeRead' ) } </ option >
440- < option value = "read,write" > { t ( 'account.apiScopeBoth' ) } </ option >
441- </ select >
442- < select
443- className = "input max-w-[13rem]"
428+ onChange = { ( v ) => setNt ( { ...nt , scopes : v . split ( ',' ) as ( 'read' | 'write' ) [ ] } ) }
429+ options = { [
430+ { value : 'write' , label : t ( 'account.apiScopeWrite' ) } ,
431+ { value : 'read' , label : t ( 'account.apiScopeRead' ) } ,
432+ { value : 'read,write' , label : t ( 'account.apiScopeBoth' ) } ,
433+ ] }
434+ />
435+ < Select
436+ className = "w-[13rem]"
444437 value = { nt . folderId }
445- onChange = { ( e ) => setNt ( { ...nt , folderId : e . target . value } ) }
446- >
447- < option value = "" > { t ( 'account.apiTokenAnyFolder' ) } </ option >
448- { folders
449- . filter ( ( f ) => ! f . isZeroKnowledge )
450- . map ( ( f ) => (
451- < option key = { f . id } value = { f . id } >
452- { f . name }
453- </ option >
454- ) ) }
455- </ select >
438+ onChange = { ( v ) => setNt ( { ...nt , folderId : v } ) }
439+ options = { [ { value : '' , label : t ( 'account.apiTokenAnyFolder' ) } , ...folderOptions ] }
440+ />
456441 < input
457442 className = "input max-w-[8rem]"
458443 type = "number"
0 commit comments