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;