import { useRef, useEffect } from "react"; import { Box, Button, Stack, Typography } from "@mui/material"; import { useTheme } from "@emotion/react"; import { useSelector } from "react-redux"; import TextInput from "../../../../Components/Inputs/TextInput"; import { PasswordEndAdornment } from "../../../../Components/Inputs/TextInput/Adornments"; import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded"; import PropTypes from "prop-types"; import { useTranslation } from "react-i18next"; /** * Renders the password step of the login process, including a password input field. * * @param {Object} props * @param {Object} props.form - Form state object. * @param {Object} props.errors - Object containing form validation errors. * @param {Function} props.onSubmit - Callback function to handle form submission. * @param {Function} props.onChange - Callback function to handle form input changes. * @param {Function} props.onBack - Callback function to handle "Back" button click. * @returns {JSX.Element} */ const PasswordStep = ({ form, errors, onSubmit, onChange, onBack }) => { const theme = useTheme(); const inputRef = useRef(null); const authState = useSelector((state) => state.auth); const { t } = useTranslation(); useEffect(() => { if (inputRef.current) { inputRef.current.focus(); } }, []); return ( <> {t("auth.login.heading")} {t("auth.login.subheadings.stepTwo")} } /> ); }; PasswordStep.propTypes = { form: PropTypes.object.isRequired, errors: PropTypes.object.isRequired, onSubmit: PropTypes.func.isRequired, onChange: PropTypes.func.isRequired, onBack: PropTypes.func.isRequired, }; export default PasswordStep;