|
|
@ -1,4 +1,4 @@ |
|
|
import type React from "react"; |
|
|
import React, { useState } from "react"; |
|
|
|
|
|
|
|
|
import { FiBluetooth, FiTerminal, FiWifi } from "react-icons/fi"; |
|
|
import { FiBluetooth, FiTerminal, FiWifi } from "react-icons/fi"; |
|
|
|
|
|
|
|
|
@ -8,23 +8,26 @@ import { HTTP } from "./PageComponents/Connect/HTTP.js"; |
|
|
import { Serial } from "./PageComponents/Connect/Serial.js"; |
|
|
import { Serial } from "./PageComponents/Connect/Serial.js"; |
|
|
|
|
|
|
|
|
export const NewDevice = () => { |
|
|
export const NewDevice = () => { |
|
|
const tabs: TabType[] = [ |
|
|
const [tabs, _setTabs] = useState<TabType[]>([ |
|
|
{ |
|
|
{ |
|
|
name: "BLE", |
|
|
name: "BLE", |
|
|
icon: <FiBluetooth className="h-4" />, |
|
|
icon: <FiBluetooth className="h-4" />, |
|
|
element: BLE, |
|
|
element: BLE, |
|
|
|
|
|
disabled: !navigator.bluetooth |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: "HTTP", |
|
|
name: "HTTP", |
|
|
icon: <FiWifi className="h-4" />, |
|
|
icon: <FiWifi className="h-4" />, |
|
|
element: HTTP, |
|
|
element: HTTP, |
|
|
|
|
|
disabled: false |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: "Serial", |
|
|
name: "Serial", |
|
|
icon: <FiTerminal className="h-4" />, |
|
|
icon: <FiTerminal className="h-4" />, |
|
|
element: Serial, |
|
|
element: Serial, |
|
|
}, |
|
|
disabled: !navigator.serial |
|
|
]; |
|
|
} |
|
|
|
|
|
]); |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<div className="m-auto h-96 w-96"> |
|
|
<div className="m-auto h-96 w-96"> |
|
|
|