import React, { useState } from 'react'; import { TextField, Button, RadioGroup, FormControlLabel, Radio, Box, Typography } from '@mui/material'; import { styled } from '@mui/system'; import axios from 'axios'; const FormContainer = styled(Box)({ display: 'flex', flexDirection: 'column', gap: '16px', padding: '20px', backgroundColor: '#f9f9f9', borderRadius: '8px', }); const FormControl = styled(Box)({ marginBottom: '16px', }); const ProxyForm: React.FC = () => { const [proxyConfig, setProxyConfig] = useState({ type: 'http', server: '', username: '', password: '', }); const handleChange = (e: React.ChangeEvent) => { const { name, value } = e.target; setProxyConfig({ ...proxyConfig, [name]: value }); }; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); try { const response = await axios.post('/api/proxy', proxyConfig); alert(`Success!`); } catch (error) { alert('Error submitting proxy configuration'); } }; return (
Select Proxy Type } label="HTTP" /> } label="HTTPS" /> } label="SOCKS5" />
); }; export default ProxyForm;