import { Checkbox, Pane, RadioGroup, SelectField } from 'evergreen-ui'; import { useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import i18n from '../i18n'; import { Translations } from '../translations'; import './style.css'; export const Settings = (props) => { const { t } = useTranslation(); const encryptionModes = [ { label: t('wifi.password.encryption.none'), value: '' }, { label: 'WPA/WPA2/WPA3', value: 'WPA' }, { label: 'WPA2-EAP', value: 'WPA2-EAP' }, { label: 'WEP', value: 'WEP' }, ]; const eapMethods = [{ label: 'PWD', value: 'PWD' }]; const langSelectDefaultValue = () => { const t = Translations.filter((t) => t.id === i18n.language); if (t.length !== 1) { return 'en-US'; } return t[0].id; }; useEffect(() => { if (props.firstLoad.current && window.innerWidth < 500) { props.onFirstLoad(); props.onOrientationChange(true); } }); return ( props.onLanguageChange(e.target.value)} defaultValue={langSelectDefaultValue()} > {Translations.map((t) => ( ))} props.onOrientationChange(!props.settings.portrait)} /> props.onHidePasswordChange(!props.settings.hidePassword) } /> props.onHiddenSSIDChange(!props.settings.hiddenSSID)} /> props.onEncryptionModeChange(e.target.value)} /> props.onEapMethodChange(e.target.value)} /> ); };