Files
no-copy-frontend/src/app/ui/settings/safety-settings.tsx
T

50 lines
1.3 KiB
TypeScript
Raw Normal View History

2025-12-01 15:21:56 +07:00
'use client'
import { useActionState, useState } from 'react';
2025-12-17 16:41:07 +07:00
import { useTranslations } from 'next-intl';
2025-12-01 15:21:56 +07:00
export default function SafetySetting() {
const [errorMessage, formAction, isPending] = useActionState(
(state: void | undefined, formData: FormData) => {
console.log(formData);
},
undefined
);
2025-12-17 16:41:07 +07:00
const t = useTranslations('Global');
2025-12-01 15:21:56 +07:00
return (
<div className="settings-form">
<div className="form-section">
2025-12-17 16:41:07 +07:00
<h3 className="form-section-title">
{t('security')}
</h3>
2025-12-01 15:21:56 +07:00
<form action={formAction}>
<div className="form-group">
2025-12-17 16:41:07 +07:00
<label className="form-label">
{t('current-password')}:
</label>
2025-12-01 15:21:56 +07:00
<input type="password" name="current_password" className="form-input" />
</div>
<div className="form-group">
2025-12-17 16:41:07 +07:00
<label className="form-label">
{t('new-password')}:
</label>
2025-12-01 15:21:56 +07:00
<input type="password" name="new_password" className="form-input" />
2025-12-17 16:41:07 +07:00
<small>
{t('minimum-8-characters')}
</small>
2025-12-01 15:21:56 +07:00
</div>
<div className="form-group">
2025-12-17 16:41:07 +07:00
<label className="form-label">
{t('confirm-password')}:
</label>
2025-12-01 15:21:56 +07:00
<input type="password" name="confirm_password" className="form-input" />
</div>
2025-12-17 16:41:07 +07:00
<button type="submit" className="btn btn-primary">
{t('change-password')}
</button>
2025-12-01 15:21:56 +07:00
</form>
</div>
</div>
)
}