refactoring, check auth

This commit is contained in:
2025-07-05 19:48:05 +05:00
parent e21a51482a
commit 12f7ea8d1c
8 changed files with 440 additions and 267 deletions

View File

@ -0,0 +1,39 @@
import { Box, Button, TextField, Typography } from '@mui/material';
interface AuthFormProps {
config: {
username: string;
password: string;
};
handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
onLogin: () => void;
}
const AuthForm = ({ config, handleInputChange, onLogin }: AuthFormProps) => {
return (
<Box sx={{ display: 'flex', flexDirection: 'column', gap: '1.5vw' }}>
<TextField
required
name="username"
label="Введите ник"
variant="outlined"
value={config.username}
onChange={handleInputChange}
/>
<TextField
required
type="password"
name="password"
label="Введите пароль"
variant="outlined"
value={config.password}
onChange={handleInputChange}
/>
<Button onClick={onLogin} variant="contained">
Войти
</Button>
</Box>
);
};
export default AuthForm;

View File

@ -0,0 +1,26 @@
import { Slider } from '@mui/material';
interface MemorySliderProps {
memory: number;
onChange: (e: Event, value: number | number[]) => void;
}
const MemorySlider = ({ memory, onChange }: MemorySliderProps) => {
return (
<Slider
name="memory"
aria-label="Memory"
defaultValue={4096}
valueLabelDisplay="auto"
shiftStep={1024}
step={1024}
marks
min={1024}
max={32628}
value={memory}
onChange={onChange}
/>
);
};
export default MemorySlider;