"use client"; import { Box, Typography } from "@mui/material"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import Button from "@atoms/Button"; import Input from "@atoms/Input"; import Label from "@atoms/Label"; import { ResetPassword } from "@package/config/api/Admin/auth/ResetPassword/page"; const ForgotPasswordForm: React.FC = () => { const [email, setEmail] = useState(""); const [message, setMessage] = useState(null); const [error, setError] = useState(null); const { t } = useTranslation(); const handleResetPassword = async () => { try { const response = await ResetPassword({ id: email }); if (response.correct) { setMessage(t("msj_Password_reset_email_sent")); setError(null); } else { setError(response.message || t("msj_Error_sending_password_reset")); setMessage(null); } } catch (err) { setError(t("msj_Error_sending_password_reset")); setMessage(null); } }; return ( {t("lbl_reset_password")} {message && {message}} {error && {error}}