|
1
|
import { Laptop, Monitor } from "lucide-react"; |
|
2
|
import { cn } from "@/lib/utils"; |
|
3
|
|
|
4
|
interface DeviceSelectorProps { |
|
5
|
selectedType: "laptop" | "desktop"; |
|
6
|
onTypeChange: (type: "laptop" | "desktop") => void; |
|
7
|
} |
|
8
|
|
|
9
|
export default function DeviceSelector({ selectedType, onTypeChange }: DeviceSelectorProps) { |
|
10
|
return ( |
|
11
|
<div className="flex gap-4"> |
|
12
|
<button |
|
13
|
onClick={() => onTypeChange("laptop")} |
|
14
|
className={cn( |
|
15
|
"flex-1 group relative flex items-center justify-center gap-3 px-6 py-4 rounded-2xl border transition-all duration-300", |
|
16
|
selectedType === "laptop" |
|
17
|
? "bg-primary border-primary text-primary-foreground shadow-glass" |
|
18
|
: "bg-muted/40 border-border/40 text-muted-foreground hover:bg-muted hover:text-foreground" |
|
19
|
)} |
|
20
|
> |
|
21
|
<Laptop className={cn("h-5 w-5 transition-transform", selectedType === "laptop" ? "scale-110" : "group-hover:scale-110")} /> |
|
22
|
<span className="font-bold text-sm tracking-wide">Laptops</span> |
|
23
|
{selectedType === "laptop" && ( |
|
24
|
<div className="absolute -bottom-1 left-1/2 -translate-x-1/2 w-1 h-1 bg-white rounded-full shadow-[0_0_8px_white]" /> |
|
25
|
)} |
|
26
|
</button> |
|
27
|
|
|
28
|
<button |
|
29
|
onClick={() => onTypeChange("desktop")} |
|
30
|
className={cn( |
|
31
|
"flex-1 group relative flex items-center justify-center gap-3 px-6 py-4 rounded-2xl border transition-all duration-300", |
|
32
|
selectedType === "desktop" |
|
33
|
? "bg-primary border-primary text-primary-foreground shadow-glass" |
|
34
|
: "bg-muted/40 border-border/40 text-muted-foreground hover:bg-muted hover:text-foreground" |
|
35
|
)} |
|
36
|
> |
|
37
|
<Monitor className={cn("h-5 w-5 transition-transform", selectedType === "desktop" ? "scale-110" : "group-hover:scale-110")} /> |
|
38
|
<span className="font-bold text-sm tracking-wide">Desktops</span> |
|
39
|
{selectedType === "desktop" && ( |
|
40
|
<div className="absolute -bottom-1 left-1/2 -translate-x-1/2 w-1 h-1 bg-white rounded-full shadow-[0_0_8px_white]" /> |
|
41
|
)} |
|
42
|
</button> |
|
43
|
</div> |
|
44
|
); |
|
45
|
} |