36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
'use client'
|
|||
|
|
|
||
|
|
import { useActionState, useState } from 'react';
|
||
|
|
|
||
|
|
export default function SafetySetting() {
|
||
|
|
const [errorMessage, formAction, isPending] = useActionState(
|
||
|
|
(state: void | undefined, formData: FormData) => {
|
||
|
|
console.log(formData);
|
||
|
|
},
|
||
|
|
undefined
|
||
|
|
);
|
||
|
|
|
||
|
|
return (
|
||
|
|
<div className="settings-form">
|
||
|
|
<div className="form-section">
|
||
|
|
<h3 className="form-section-title">🔐 Безопасность</h3>
|
||
|
|
<form action={formAction}>
|
||
|
|
<div className="form-group">
|
||
|
|
<label className="form-label">🔓 Текущий пароль:</label>
|
||
|
|
<input type="password" name="current_password" className="form-input" />
|
||
|
|
</div>
|
||
|
|
<div className="form-group">
|
||
|
|
<label className="form-label">🔓 Новый пароль:</label>
|
||
|
|
<input type="password" name="new_password" className="form-input" />
|
||
|
|
<small>Минимум 6 символов</small>
|
||
|
|
</div>
|
||
|
|
<div className="form-group">
|
||
|
|
<label className="form-label">✅ Подтвердите пароль:</label>
|
||
|
|
<input type="password" name="confirm_password" className="form-input" />
|
||
|
|
</div>
|
||
|
|
<button type="submit" className="btn btn-primary">🔐 Изменить пароль</button>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
)
|
||
|
|
}
|