@@ -101,8 +101,8 @@ const DraftOrcaDashboard = () => {
101
101
file_path : filePath . toString ( ) ,
102
102
search_terms : searchTerms . split ( "," ) ,
103
103
sections : sections . type === "Custom"
104
- ? sections . value . split ( "," ) // Convert custom value into an array
105
- : sections . value . split ( "," ) , // Handle First/Last consistently
104
+ ? sections . value . split ( "," )
105
+ : sections . value . split ( "," ) ,
106
106
specify_lines : specifyLines . toString ( ) ,
107
107
} ;
108
108
@@ -176,8 +176,8 @@ const DraftOrcaDashboard = () => {
176
176
file_path : filePath . toString ( ) ,
177
177
search_terms : searchTerms . split ( "," ) ,
178
178
sections : sections . type === "Custom"
179
- ? sections . value . split ( "," ) // Convert custom value into an array
180
- : sections . value . split ( "," ) , // Handle First/Last consistently
179
+ ? sections . value . split ( "," )
180
+ : sections . value . split ( "," ) ,
181
181
specify_lines : specifyLines . toString ( ) ,
182
182
} ;
183
183
@@ -268,40 +268,38 @@ const DraftOrcaDashboard = () => {
268
268
</ div >
269
269
270
270
< div className = "mb-3 text-start" >
271
- < span > Number of sections?</ span >
272
- < select
273
- className = "form-select mb-2"
274
- value = { sections . type || "Custom" } // Bind the value to sections.type
275
- onChange = { ( e ) => {
276
- const selectedValue = e . target . value ;
277
- if ( selectedValue === "First" ) {
278
- setSections ( { type : "First" , value : "1" } ) ; // Consistent object format
279
- } else if ( selectedValue === "Last" ) {
280
- setSections ( { type : "Last" , value : "0" } ) ; // Consistent object format
281
- } else {
282
- setSections ( { type : "Custom" , value : "" } ) ; // Clear for custom input
283
- }
284
- } }
285
- >
286
- < option value = "First" > First</ option >
287
- < option value = "Last" > Last</ option >
288
- < option value = "Custom" > Custom</ option >
289
- </ select >
290
-
291
- { /* Custom input field */ }
292
- { sections . type === "Custom" && (
293
- < input
294
- type = "text"
295
- className = "form-control"
296
- placeholder = "Enter custom sections (e.g., 1-5 or 1,3,5)"
297
- value = { sections . value } // Bind to sections.value
298
- onChange = { ( e ) =>
299
- setSections ( { type : "Custom" , value : e . target . value . trim ( ) } )
300
- }
301
- />
302
- ) }
271
+ < span > Number of sections?</ span >
272
+ < select
273
+ className = "form-select mb-2"
274
+ value = { sections . type || "Custom" }
275
+ onChange = { ( e ) => {
276
+ const selectedValue = e . target . value ;
277
+ if ( selectedValue === "First" ) {
278
+ setSections ( { type : "First" , value : "1" } ) ;
279
+ } else if ( selectedValue === "Last" ) {
280
+ setSections ( { type : "Last" , value : "0" } ) ;
281
+ } else {
282
+ setSections ( { type : "Custom" , value : "" } ) ;
283
+ }
284
+ } }
285
+ >
286
+ < option value = "First" > First</ option >
287
+ < option value = "Last" > Last</ option >
288
+ < option value = "Custom" > Custom</ option >
289
+ </ select >
303
290
304
- </ div >
291
+ { sections . type === "Custom" && (
292
+ < input
293
+ type = "text"
294
+ className = "form-control"
295
+ placeholder = "Enter custom sections (e.g., 1-5 or 1,3,5)"
296
+ value = { sections . value }
297
+ onChange = { ( e ) =>
298
+ setSections ( { type : "Custom" , value : e . target . value . trim ( ) } )
299
+ }
300
+ />
301
+ ) }
302
+ </ div >
305
303
306
304
307
305
0 commit comments