File tree Expand file tree Collapse file tree
src/lib/components/ControlModules/dialogs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 // svelte-ignore state_referenced_locally -- intentionally captures initial value as own reactive copy
4040 let data: AddShockerData = $state (initialData );
4141
42- const modelOptions = [
43- { value: ShockerModelType .CaiXianlin , label: ' CaiXianlin' },
44- { value: ShockerModelType .PetTrainer , label: ' PetTrainer' },
45- { value: ShockerModelType .Petrainer998Dr , label: ' Petrainer998DR' },
46- ];
47-
4842 let canSubmit = $derived (data .name .trim ().length > 0 && data .rfId > 0 && data .device .length > 0 );
4943
5044 function submit() {
7468 <FieldLabel >Model</FieldLabel >
7569 <Select .Root type ="single" name ="model" bind:value ={data .model }>
7670 <Select .Trigger >
77- {modelOptions . find (( o ) => o . value === data .model )?. label ?? ' Select model' }
71+ {data .model ?? ' Select model' }
7872 </Select .Trigger >
7973 <Select .Content >
8074 <Select .Group >
81- {#each modelOptions as option (option . value )}
82- <Select .Item value ={option . value } label ={option . label }>{option . label }</Select .Item >
75+ {#each Object . values ( ShockerModelType ) as option (option )}
76+ <Select .Item value ={option } label ={option }>{option }</Select .Item >
8377 {/each }
8478 </Select .Group >
8579 </Select .Content >
You can’t perform that action at this time.
0 commit comments