add translate and make refactor

This commit is contained in:
smanylov
2025-12-17 16:41:07 +07:00
parent fd59fb3e5e
commit 9b8cb3b583
13 changed files with 261 additions and 83 deletions
+20 -6
View File
@@ -1,6 +1,7 @@
'use client'
import { useActionState, useState } from 'react';
import { useTranslations } from 'next-intl';
export default function SafetySetting() {
const [errorMessage, formAction, isPending] = useActionState(
@@ -9,26 +10,39 @@ export default function SafetySetting() {
},
undefined
);
const t = useTranslations('Global');
return (
<div className="settings-form">
<div className="form-section">
<h3 className="form-section-title">🔐 Безопасность</h3>
<h3 className="form-section-title">
{t('security')}
</h3>
<form action={formAction}>
<div className="form-group">
<label className="form-label">🔓 Текущий пароль:</label>
<label className="form-label">
{t('current-password')}:
</label>
<input type="password" name="current_password" className="form-input" />
</div>
<div className="form-group">
<label className="form-label">🔓 Новый пароль:</label>
<label className="form-label">
{t('new-password')}:
</label>
<input type="password" name="new_password" className="form-input" />
<small>Минимум 6 символов</small>
<small>
{t('minimum-8-characters')}
</small>
</div>
<div className="form-group">
<label className="form-label"> Подтвердите пароль:</label>
<label className="form-label">
{t('confirm-password')}:
</label>
<input type="password" name="confirm_password" className="form-input" />
</div>
<button type="submit" className="btn btn-primary">🔐 Изменить пароль</button>
<button type="submit" className="btn btn-primary">
{t('change-password')}
</button>
</form>
</div>
</div>