From 65572ef95b27dd96ad0e5ccd22031d6f2f743f5a Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:16:57 +0330 Subject: [PATCH] Import source: src/components/CenterPanel/forms/WiFiForm Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- src/components/CenterPanel/forms/WiFiForm.tsx | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/components/CenterPanel/forms/WiFiForm.tsx diff --git a/src/components/CenterPanel/forms/WiFiForm.tsx b/src/components/CenterPanel/forms/WiFiForm.tsx new file mode 100644 index 0000000..ec0ee71 --- /dev/null +++ b/src/components/CenterPanel/forms/WiFiForm.tsx @@ -0,0 +1,35 @@ +import { useQR } from '../../../context/QRContext'; +import { TextInput } from '../../ui/TextInput'; +import { SegmentedControl } from '../../ui/SegmentedControl'; +import type { WifiEncryption } from '../../../types'; + +const ENCRYPTION_OPTIONS: { label: string; value: WifiEncryption }[] = [ + { label: 'WPA', value: 'WPA' }, + { label: 'WEP', value: 'WEP' }, + { label: 'None', value: 'None' }, +]; + +export function WiFiForm() { + const { state, dispatch } = useQR(); + const { networkName, encryption, password } = state.formData.wifi; + + const set = (field: string, value: string) => + dispatch({ type: 'SET_FORM_FIELD', qrType: 'wifi', field, value }); + + return ( +
+ set('networkName', v)} placeholder="My WiFi Network" /> +
+ + set('encryption', v)} + /> +
+ {encryption !== 'None' && ( + set('password', v)} placeholder="Enter password" type="password" /> + )} +
+ ); +}