feat: standard proxy and automatic proxy rotation tabs

This commit is contained in:
karishmas6
2024-10-24 18:26:11 +05:30
parent dac5720b4f
commit 1c13845302

View File

@@ -1,6 +1,6 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { styled } from '@mui/system'; import { styled } from '@mui/system';
import { TextField, Button, Switch, FormControlLabel, Box, Typography } from '@mui/material'; import { TextField, Button, Switch, FormControlLabel, Box, Typography, Tabs, Tab } from '@mui/material';
import { sendProxyConfig } from '../../api/proxy'; import { sendProxyConfig } from '../../api/proxy';
import { useGlobalInfoStore } from '../../context/globalInfo'; import { useGlobalInfoStore } from '../../context/globalInfo';
@@ -27,6 +27,7 @@ const ProxyForm: React.FC = () => {
username: '', username: '',
password: '', password: '',
}); });
const [tabIndex, setTabIndex] = useState(0);
const { notify } = useGlobalInfoStore(); const { notify } = useGlobalInfoStore();
@@ -82,11 +83,20 @@ const ProxyForm: React.FC = () => {
}); });
}; };
const handleTabChange = (event: React.SyntheticEvent, newValue: number) => {
setTabIndex(newValue);
};
return ( return (
<FormContainer> <FormContainer>
<Typography variant="h6" gutterBottom component="div" style={{ marginTop: '20px' }}> <Typography variant="h6" gutterBottom component="div" style={{ marginTop: '20px' }}>
Proxy Configuration Proxy Configuration
</Typography> </Typography>
<Tabs value={tabIndex} onChange={handleTabChange}>
<Tab label="Standard Proxy" />
<Tab label="Automatic Proxy Rotation" />
</Tabs>
{tabIndex === 0 && (
<Box component="form" onSubmit={handleSubmit} sx={{ maxWidth: 400, width: '100%' }}> <Box component="form" onSubmit={handleSubmit} sx={{ maxWidth: 400, width: '100%' }}>
<FormControl> <FormControl>
<TextField <TextField
@@ -147,6 +157,14 @@ const ProxyForm: React.FC = () => {
Add Proxy Add Proxy
</Button> </Button>
</Box> </Box>
)}
{tabIndex === 1 && (
<Box sx={{ maxWidth: 400, width: '100%', textAlign: 'center', marginTop: '20px' }}>
<Button variant="contained" color="primary">
Join Our Cloud Waitlist
</Button>
</Box>
)}
</FormContainer> </FormContainer>
); );
}; };