"use client"; import React, { useState, useEffect } from "react"; import { Text, Button, TextInput, PasswordInput, Title, Card, Group, Flex, Box, Image, Anchor, Stack, Container, rem, Grid } from "@mantine/core"; import { notifications } from "@mantine/notifications"; import { Providers } from "@/app/providers"; import { useRouter } from "next/navigation"; import NextImage from "next/image"; import myImage from '@/app/image/ebanking.jpg'; import changePwdImage from '@/app/image/changepw.png'; import dynamic from 'next/dynamic'; import RegistrationTimeline from '../_components/timeline/RegistrationTimeline'; import CaptchaImage from './CaptchaImage'; // adjust path if needed function generateCaptcha(length = 6) { const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; return Array.from({ length }, () => chars[Math.floor(Math.random() * chars.length)]).join(""); } export default function Login() { const router = useRouter(); // const [error, setError] = useState(null); //const [CIF, SetCIF] = useState(""); // const [psw, SetPsw] = useState(""); const [captcha, setCaptcha] = useState(""); const [inputCaptcha, setInputCaptcha] = useState(""); const [password, setPassword] = useState(""); const [confirmPassword, setConfirmPassword] = useState(""); const [error, setError] = useState(""); const ClientCarousel = dynamic(() => import('./clientCarousel'), { ssr: false }); // const [captcha, setCaptcha] = useState(''); const [captchaInput, setCaptchaInput] = useState(''); const [captchaError, setCaptchaError] = useState(''); // useEffect(() => { // setCaptcha(generateCaptcha()); // }, []); // const regenerateCaptcha = () => { // setCaptcha(generateCaptcha()); // setInputCaptcha(""); // }; useEffect(() => { generateCaptcha(); }, []); const generateCaptcha = () => { const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; let result = ''; for (let i = 0; i < 6; i++) { result += chars.charAt(Math.floor(Math.random() * chars.length)); } setCaptcha(result); setCaptchaInput(''); setCaptchaError(''); }; return (
ebanking
Change Password Image Change User Login Password
e.preventDefault()} onPaste={(e) => e.preventDefault()} onCut={(e) => e.preventDefault()} /> e.preventDefault()} onPaste={(e) => e.preventDefault()} onCut={(e) => e.preventDefault()} /> {/* CAPTCHA */}
setCaptchaInput(e.currentTarget.value)} required /> {captchaError &&

{captchaError}

}
{/* */} {/* */}

Note: Password will contains minimum one alphabet, one digit, one special symbol and total 8 charecters.
© 2025 KCC Bank. All rights reserved. {" "}
); }