Files
sexy/components/control/DeviceScanPanel.tsx
T

27 lines
665 B
TypeScript
Raw Normal View History

"use client";
import { Button } from "@/components/ui/button";
import { Bluetooth, LoaderCircle } from "lucide-react";
interface DeviceScanPanelProps {
scanning: boolean;
onScan: () => void;
onStopScan: () => void;
}
export function DeviceScanPanel({ scanning, onScan, onStopScan }: DeviceScanPanelProps) {
return (
<Button onClick={scanning ? onStopScan : onScan} variant={scanning ? "outline" : "default"}>
{scanning ? (
<>
<LoaderCircle className="size-4 animate-spin" /> Stop scanning
</>
) : (
<>
<Bluetooth className="size-4" /> Scan for devices
</>
)}
</Button>
);
}