// Import useState hook from React
import { useState } from "react";

// Custom hook for managing password visibility
export const usePasswoordVisibility = () => {
    // Initialize state for password visibility
    const [values, setValues] = useState({
        showPassword: false,
    });

    // Toggle password visibility
    const handleClickShowPassword = () => {
        setValues({
            ...values,
            showPassword: !values.showPassword,
        });
    };

    // Prevent default action on mouse down event
    const handleMouseDownPassword = (event: any) => {
        event.preventDefault();
    };

    // Return state and handlers
    return {values, handleClickShowPassword, handleMouseDownPassword};
}