@@ -2,7 +2,7 @@ import React, { useState, useRef, useCallback } from "react"
22
33import { Button } from "@/components/ui/button"
44import { Separator } from "@/components/ui/separator"
5- import { Cpu , Layers , Settings , Target , Upload , Zap } from "lucide-react"
5+ import { Cpu , Layers , Settings , Upload , Zap } from "lucide-react"
66import { useWorkspace } from "./workspace-context"
77
88export function SettingsPanel ( ) {
@@ -132,29 +132,6 @@ export function SettingsPanel() {
132132 await processCircuitFile ( files [ 0 ] )
133133 }
134134 }
135- // Helper function to create toggle buttons
136- const ToggleButton = ( {
137- value,
138- onChange,
139- label,
140- } : {
141- value : boolean
142- onChange : ( value : boolean ) => void
143- label : string
144- } ) => (
145- < div className = "flex items-center justify-between min-w-0" >
146- < span className = "text-sm truncate" > { label } </ span >
147- < Button
148- variant = { value ? "default" : "outline" }
149- size = "sm"
150- onClick = { ( ) => onChange ( ! value ) }
151- className = "w-16"
152- >
153- { value ? "On" : "Off" }
154- </ Button >
155- </ div >
156- )
157-
158135 // Helper function for numeric controls
159136 const NumericControl = ( {
160137 value,
@@ -284,107 +261,10 @@ export function SettingsPanel() {
284261 </ div >
285262 </ div >
286263
287- < Separator />
288-
289- { /* Basic Settings Section */ }
290- < div className = "space-y-3" >
291- < div className = "flex items-center gap-2" >
292- < Layers className = "size-4" />
293- < h4 className = "text-sm font-medium" > Basic Settings</ h4 >
294- </ div >
295- < div className = "space-y-3 pl-6" >
296- < ToggleButton
297- value = { lbrnOptions . includeCopper ?? true }
298- onChange = { ( value ) =>
299- setLbrnOptions ( { ...lbrnOptions , includeCopper : value } )
300- }
301- label = "Include Copper"
302- />
303- < ToggleButton
304- value = { lbrnOptions . includeSoldermask ?? false }
305- onChange = { ( value ) =>
306- setLbrnOptions ( { ...lbrnOptions , includeSoldermask : value } )
307- }
308- label = "Include Soldermask"
309- />
310- < ToggleButton
311- value = { lbrnOptions . includeCopperCutFill ?? false }
312- onChange = { ( value ) =>
313- setLbrnOptions ( { ...lbrnOptions , includeCopperCutFill : value } )
314- }
315- label = "Include Copper Cut Fill"
316- />
317- { /* Layer Selection */ }
318- < div className = "flex items-center justify-between" >
319- < span className = "text-sm" > Layers</ span >
320- < div className = "flex gap-1" >
321- < Button
322- variant = {
323- ( lbrnOptions . includeLayers ?? [ "top" , "bottom" ] ) . includes (
324- "top" ,
325- )
326- ? "default"
327- : "outline"
328- }
329- size = "sm"
330- className = "w-16"
331- onClick = { ( ) =>
332- setLbrnOptions ( {
333- ...lbrnOptions ,
334- includeLayers : (
335- lbrnOptions . includeLayers ?? [ "top" , "bottom" ]
336- ) . includes ( "top" )
337- ? ( lbrnOptions . includeLayers ?? [ "top" , "bottom" ] ) . filter (
338- ( l : "top" | "bottom" ) => l !== "top" ,
339- )
340- : [
341- ...( lbrnOptions . includeLayers ?? [ "top" , "bottom" ] ) ,
342- "top" ,
343- ] ,
344- } )
345- }
346- >
347- Top
348- </ Button >
349- < Button
350- variant = {
351- ( lbrnOptions . includeLayers ?? [ "top" , "bottom" ] ) . includes (
352- "bottom" ,
353- )
354- ? "default"
355- : "outline"
356- }
357- size = "sm"
358- className = "w-16"
359- onClick = { ( ) =>
360- setLbrnOptions ( {
361- ...lbrnOptions ,
362- includeLayers : (
363- lbrnOptions . includeLayers ?? [ "top" , "bottom" ]
364- ) . includes ( "bottom" )
365- ? ( lbrnOptions . includeLayers ?? [ "top" , "bottom" ] ) . filter (
366- ( l : "top" | "bottom" ) => l !== "bottom" ,
367- )
368- : [
369- ...( lbrnOptions . includeLayers ?? [ "top" , "bottom" ] ) ,
370- "bottom" ,
371- ] ,
372- } )
373- }
374- >
375- Bottom
376- </ Button >
377- </ div >
378- </ div >
379- </ div >
380- </ div >
381-
382- < Separator />
383-
384264 { /* Advanced Settings Section */ }
385265 < div className = "space-y-3" >
386266 < div className = "flex items-center gap-2" >
387- < Target className = "size-4" />
267+ < Layers className = "size-4" />
388268 < h4 className = "text-sm font-medium" > Advanced Settings</ h4 >
389269 </ div >
390270 < div className = "space-y-3 pl-6" >
0 commit comments