1 import { Laptop, Monitor, LayoutGrid } from "lucide-react";
2 import { cn } from "@/lib/utils";
3
4 interface DeviceSelectorProps {
5 selectedType: "all" | "laptop" | "desktop";
6 onTypeChange: (type: "all" | "laptop" | "desktop") => void;
7 }
8
9 export default function DeviceSelector({ selectedType, onTypeChange }: DeviceSelectorProps) {
10 return (
11 <div className="flex items-center p-1 rounded-2xl bg-muted/60 border border-border/50 shadow-inner max-w-md">
12 <button
13 type="button"
14 onClick={() => onTypeChange("all")}
15 className={cn(
16 "flex-1 group relative flex items-center justify-center gap-2 px-3 sm:px-4 py-2 rounded-xl text-xs font-bold transition-all cursor-pointer",
17 selectedType === "all"
18 ? "bg-background text-foreground shadow-xs ring-1 ring-border/50"
19 : "text-muted-foreground hover:text-foreground"
20 )}
21 >
22 <LayoutGrid className="h-3.5 w-3.5 text-primary" />
23 <span className="truncate">All Systems</span>
24 </button>
25
26 <button
27 type="button"
28 onClick={() => onTypeChange("laptop")}
29 className={cn(
30 "flex-1 group relative flex items-center justify-center gap-2 px-3 sm:px-4 py-2 rounded-xl text-xs font-bold transition-all cursor-pointer",
31 selectedType === "laptop"
32 ? "bg-background text-foreground shadow-xs ring-1 ring-border/50"
33 : "text-muted-foreground hover:text-foreground"
34 )}
35 >
36 <Laptop className="h-3.5 w-3.5 text-indigo-500" />
37 <span className="truncate">Laptops</span>
38 </button>
39
40 <button
41 type="button"
42 onClick={() => onTypeChange("desktop")}
43 className={cn(
44 "flex-1 group relative flex items-center justify-center gap-2 px-3 sm:px-4 py-2 rounded-xl text-xs font-bold transition-all cursor-pointer",
45 selectedType === "desktop"
46 ? "bg-background text-foreground shadow-xs ring-1 ring-border/50"
47 : "text-muted-foreground hover:text-foreground"
48 )}
49 >
50 <Monitor className="h-3.5 w-3.5 text-emerald-500" />
51 <span className="truncate">Desktops & PCs</span>
52 </button>
53 </div>
54 );
55 }