@@ -6,6 +6,7 @@ import { Layers, Move, RotateCcwSquare, RotateCwSquare } from "lucide-react"
66import { useWorkspace } from "./workspace-context"
77import { useState , useRef } from "react"
88import { useSvgGeneration , useSvgTransform } from "../hooks/preview-hooks"
9+ import { cn } from "@/utils"
910export function PreviewCanvas ( ) {
1011 const { circuitJson, lbrnOptions } = useWorkspace ( )
1112 const [ viewMode , setViewMode ] = useState < "lbrn" | "pcb" | "both" > ( "lbrn" )
@@ -55,28 +56,42 @@ export function PreviewCanvas() {
5556 < RotateCwSquare className = "size-3.5" />
5657 </ Button >
5758 </ div >
58- < div className = "flex items-center gap-0 border border-border rounded-md p-1 bg-muted/20 " >
59+ < div className = "inline- flex items-center rounded-lg bg-muted p-1" >
5960 < Button
60- variant = { viewMode === "lbrn" ? "default" : " ghost"}
61+ variant = " ghost"
6162 size = "sm"
62- className = "rounded-r-none"
6363 onClick = { ( ) => setViewMode ( "lbrn" ) }
64+ className = { cn (
65+ "rounded-md px-4 h-8 transition-all" ,
66+ viewMode === "lbrn" &&
67+ "bg-primary text-primary-foreground shadow-sm" ,
68+ ) }
6469 >
6570 LBRN
6671 </ Button >
72+
6773 < Button
68- variant = { viewMode === "pcb" ? "default" : " ghost"}
74+ variant = " ghost"
6975 size = "sm"
70- className = "rounded-none border-x"
7176 onClick = { ( ) => setViewMode ( "pcb" ) }
77+ className = { cn (
78+ "rounded-md px-4 h-8 transition-all" ,
79+ viewMode === "pcb" &&
80+ "bg-primary text-primary-foreground shadow-sm" ,
81+ ) }
7282 >
7383 PCB
7484 </ Button >
85+
7586 < Button
76- variant = { viewMode === "both" ? "default" : " ghost"}
87+ variant = " ghost"
7788 size = "sm"
78- className = "rounded-l-none"
7989 onClick = { ( ) => setViewMode ( "both" ) }
90+ className = { cn (
91+ "rounded-md px-4 h-8 transition-all" ,
92+ viewMode === "both" &&
93+ "bg-primary text-primary-foreground shadow-sm" ,
94+ ) }
8095 >
8196 Both
8297 </ Button >
0 commit comments