@@ -5,12 +5,17 @@ import { ErrorAlert } from "components/Alert/ErrorAlert";
5
5
import { Avatar } from "components/Avatar/Avatar" ;
6
6
import { Button } from "components/Button/Button" ;
7
7
import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge" ;
8
- import { SelectFilter } from "components/Filter/SelectFilter" ;
9
8
import { Input } from "components/Input/Input" ;
10
9
import { Label } from "components/Label/Label" ;
11
10
import { Pill } from "components/Pill/Pill" ;
11
+ import {
12
+ Select ,
13
+ SelectContent ,
14
+ SelectItem ,
15
+ SelectTrigger ,
16
+ SelectValue ,
17
+ } from "components/Select/Select" ;
12
18
import { Spinner } from "components/Spinner/Spinner" ;
13
- import { Stack } from "components/Stack/Stack" ;
14
19
import { Switch } from "components/Switch/Switch" ;
15
20
import { UserAutocomplete } from "components/UserAutocomplete/UserAutocomplete" ;
16
21
import { type FormikContextType , useFormik } from "formik" ;
@@ -153,11 +158,11 @@ export const CreateWorkspacePageViewExperimental: FC<
153
158
} , [ form . submitCount , form . errors ] ) ;
154
159
155
160
const [ presetOptions , setPresetOptions ] = useState ( [
156
- { label : "None" , value : "" } ,
161
+ { label : "None" , value : "None " } ,
157
162
] ) ;
158
163
useEffect ( ( ) => {
159
164
setPresetOptions ( [
160
- { label : "None" , value : "" } ,
165
+ { label : "None" , value : "None " } ,
161
166
...presets . map ( ( preset ) => ( {
162
167
label : preset . Name ,
163
168
value : preset . ID ,
@@ -421,38 +426,47 @@ export const CreateWorkspacePageViewExperimental: FC<
421
426
) }
422
427
423
428
{ parameters . length > 0 && (
424
- < section className = "flex flex-col gap-6 " >
429
+ < section className = "flex flex-col gap-9 " >
425
430
< hgroup >
426
431
< h2 className = "text-xl font-semibold m-0" > Parameters</ h2 >
427
432
< p className = "text-sm text-content-secondary m-0" >
428
433
These are the settings used by your template. Immutable
429
434
parameters cannot be modified once the workspace is created.
430
435
</ p >
431
436
</ hgroup >
432
- < Diagnostics diagnostics = { diagnostics } />
437
+ { diagnostics . length > 0 && (
438
+ < Diagnostics diagnostics = { diagnostics } />
439
+ ) }
433
440
{ presets . length > 0 && (
434
- < Stack direction = "column" spacing = { 2 } >
435
- < div className = "flex flex-col gap-2" >
436
- < div className = "flex gap-2 items-center" >
437
- < Label className = "text-sm" > Preset</ Label >
438
- < FeatureStageBadge contentType = { "beta" } size = "md" />
439
- </ div >
440
- < div className = "flex" >
441
- < SelectFilter
442
- label = "Preset"
443
- options = { presetOptions }
444
- onSelect = { ( option ) => {
441
+ < div className = "flex flex-col gap-2" >
442
+ < div className = "flex gap-2 items-center" >
443
+ < Label className = "text-sm" > Preset</ Label >
444
+ < FeatureStageBadge contentType = { "beta" } size = "md" />
445
+ </ div >
446
+ < div className = "flex flex-col gap-4" >
447
+ < div className = "max-w-lg" >
448
+ < Select
449
+ onValueChange = { ( option ) => {
445
450
const index = presetOptions . findIndex (
446
- ( preset ) => preset . value === option ?. value ,
451
+ ( preset ) => preset . value === option ,
447
452
) ;
448
453
if ( index === - 1 ) {
449
454
return ;
450
455
}
451
456
setSelectedPresetIndex ( index ) ;
452
457
} }
453
- placeholder = "Select a preset"
454
- selectedOption = { presetOptions [ selectedPresetIndex ] }
455
- />
458
+ >
459
+ < SelectTrigger >
460
+ < SelectValue placeholder = { "Select a preset" } />
461
+ </ SelectTrigger >
462
+ < SelectContent >
463
+ { presetOptions . map ( ( option ) => (
464
+ < SelectItem key = { option . value } value = { option . value } >
465
+ { option . label }
466
+ </ SelectItem >
467
+ ) ) }
468
+ </ SelectContent >
469
+ </ Select >
456
470
</ div >
457
471
< span className = "flex items-center gap-3" >
458
472
< Switch
@@ -465,7 +479,7 @@ export const CreateWorkspacePageViewExperimental: FC<
465
479
</ Label >
466
480
</ span >
467
481
</ div >
468
- </ Stack >
482
+ </ div >
469
483
) }
470
484
471
485
< div className = "flex flex-col gap-9" >
0 commit comments