import { createFileRoute } from '@tanstack/react-router' import { route } from '@/constants/routes' import HeaderPage from '@/containers/HeaderPage' import SettingsMenu from '@/containers/SettingsMenu' import { Card, CardItem } from '@/containers/Card' import { Switch } from '@/components/ui/switch' import { useTranslation } from '@/i18n/react-i18next-compat' import { Input } from '@/components/ui/input' import { EyeOff, Eye } from 'lucide-react' import { useCallback, useState } from 'react' import { useProxyConfig } from '@/hooks/useProxyConfig' // eslint-disable-next-line @typescript-eslint/no-explicit-any export const Route = createFileRoute(route.settings.https_proxy as any)({ component: HTTPSProxy, }) function HTTPSProxy() { const { t } = useTranslation() const [showPassword, setShowPassword] = useState(false) const { proxyUrl, proxyEnabled, proxyUsername, proxyPassword, proxyIgnoreSSL, noProxy, setProxyEnabled, setProxyUsername, setProxyPassword, setProxyIgnoreSSL, setNoProxy, setProxyUrl, } = useProxyConfig() const toggleProxy = useCallback( (checked: boolean) => { setProxyEnabled(checked) }, [setProxyEnabled] ) return (
{t('settings:httpsProxy.proxyUrlDesc')}
setProxyUrl(e.target.value)} />{t('settings:httpsProxy.authenticationDesc')}
{t('settings:httpsProxy.noProxyDesc')}
setNoProxy(e.target.value)} />