2025-09-08 15:21:17 +01:00
|
|
|
import Card from "../../UI/Card";
|
|
|
|
|
import CardHeader from "../../UI/CardHeader";
|
|
|
|
|
import { useState } from "react";
|
|
|
|
|
import FormGroup from "../components/FormGroup";
|
|
|
|
|
|
|
|
|
|
const WiFiCard = () => {
|
|
|
|
|
const [ssid, setSsid] = useState("");
|
|
|
|
|
const [password, setPassword] = useState("");
|
|
|
|
|
const [encryption, setEncryption] = useState("WPA2");
|
|
|
|
|
|
|
|
|
|
return (
|
2025-09-26 13:58:14 +01:00
|
|
|
<Card className="p-4">
|
2025-09-08 15:21:17 +01:00
|
|
|
<CardHeader title={"WiFi"} />
|
2025-09-26 13:58:14 +01:00
|
|
|
<div className="flex flex-col gap-4 px-2">
|
2025-09-08 15:21:17 +01:00
|
|
|
<FormGroup>
|
2025-09-17 11:39:26 +01:00
|
|
|
<label
|
|
|
|
|
htmlFor="ssid"
|
|
|
|
|
className="font-medium whitespace-nowrap md:w-2/3"
|
|
|
|
|
>
|
|
|
|
|
SSID
|
|
|
|
|
</label>
|
2025-09-08 15:21:17 +01:00
|
|
|
<input
|
|
|
|
|
id="ssid"
|
|
|
|
|
name="ssid"
|
|
|
|
|
type="text"
|
|
|
|
|
className="p-2 border border-gray-400 rounded-lg flex-1 md:w-2/3"
|
|
|
|
|
placeholder="Enter SSID"
|
|
|
|
|
value={ssid}
|
2025-09-17 11:39:26 +01:00
|
|
|
onChange={(e) => setSsid(e.target.value)}
|
2025-09-08 15:21:17 +01:00
|
|
|
/>
|
|
|
|
|
</FormGroup>
|
|
|
|
|
<FormGroup>
|
2025-09-17 11:39:26 +01:00
|
|
|
<label
|
|
|
|
|
htmlFor="password"
|
|
|
|
|
className="font-medium whitespace-nowrap md:w-2/3"
|
|
|
|
|
>
|
|
|
|
|
Password
|
|
|
|
|
</label>
|
2025-09-08 15:21:17 +01:00
|
|
|
<input
|
|
|
|
|
id="password"
|
|
|
|
|
name="password"
|
|
|
|
|
type="password"
|
|
|
|
|
className="p-2 border border-gray-400 rounded-lg flex-1 md:w-2/3"
|
|
|
|
|
placeholder="Enter Password"
|
|
|
|
|
value={password}
|
2025-09-17 11:39:26 +01:00
|
|
|
onChange={(e) => setPassword(e.target.value)}
|
2025-09-08 15:21:17 +01:00
|
|
|
/>
|
|
|
|
|
</FormGroup>
|
|
|
|
|
<FormGroup>
|
2025-09-17 11:39:26 +01:00
|
|
|
<label
|
|
|
|
|
htmlFor="encryption"
|
|
|
|
|
className="font-medium whitespace-nowrap md:w-2/3"
|
|
|
|
|
>
|
|
|
|
|
WPA/Encryption Type
|
|
|
|
|
</label>
|
2025-09-08 15:21:17 +01:00
|
|
|
<select
|
|
|
|
|
id="encryption"
|
|
|
|
|
name="encryption"
|
|
|
|
|
className="p-2 border border-gray-400 rounded-lg text-white bg-[#253445] flex-1 md:w-2/3"
|
|
|
|
|
value={encryption}
|
2025-09-17 11:39:26 +01:00
|
|
|
onChange={(e) => setEncryption(e.target.value)}
|
2025-09-08 15:21:17 +01:00
|
|
|
>
|
|
|
|
|
<option value="WPA2">WPA2</option>
|
|
|
|
|
<option value="WPA3">WPA3</option>
|
|
|
|
|
<option value="WEP">WEP</option>
|
|
|
|
|
<option value="None">None</option>
|
|
|
|
|
</select>
|
|
|
|
|
</FormGroup>
|
|
|
|
|
<button
|
2025-09-23 16:02:14 +01:00
|
|
|
className="bg-[#26B170] text-white px-4 py-2 rounded hover:bg-green-700 transition w-full md:w-[50%]"
|
2025-09-08 15:21:17 +01:00
|
|
|
//onClick={() => handleWiFiSave(ssid, password, encryption)}
|
|
|
|
|
>
|
|
|
|
|
Save WiFi Settings
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</Card>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default WiFiCard;
|