From 9459415216c9f57f15c18c6b2c755b359b1dfbd0 Mon Sep 17 00:00:00 2001 From: Anand Suthar Date: Sun, 28 Jul 2024 23:02:41 +0530 Subject: [PATCH] Add use client directive --- app/(pages)/admin/components/LoginForm/index.tsx | 8 +++++--- app/(pages)/admin/components/PinVerification/index.tsx | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/(pages)/admin/components/LoginForm/index.tsx b/app/(pages)/admin/components/LoginForm/index.tsx index dbc047cf..e52bdca6 100644 --- a/app/(pages)/admin/components/LoginForm/index.tsx +++ b/app/(pages)/admin/components/LoginForm/index.tsx @@ -1,3 +1,5 @@ +"use client"; + import { useState, useEffect } from "react"; import { Input, Button, Link, Card, Image } from "@nextui-org/react"; import { AiOutlineEyeInvisible, AiTwotoneEye } from "react-icons/ai"; @@ -16,13 +18,13 @@ export default function LoginForm() { const [userData, setUserData] = useState({ email: "", role: "", action: "" }); const [loginDisabled, setLoginDisabled] = useState(true); - function handleEmailChange(e) { + function handleEmailChange(e: any) { const error = FormValidator.validateEmail(e.target.value); formValidator.setError("email", error); setEmail(e.target.value); } - function handlePasswordChange(e) { + function handlePasswordChange(e: any) { const error = FormValidator.validatePassword(e.target.value); formValidator.setError("password", error); setPassword(e.target.value); @@ -34,7 +36,7 @@ export default function LoginForm() { setLoginDisabled(formValidator.hasErrors() || !email || !password); }, [email, password]); - async function handleFormSubmit(e) { + async function handleFormSubmit(e: any) { e.preventDefault(); const formData = new FormData(e.currentTarget); diff --git a/app/(pages)/admin/components/PinVerification/index.tsx b/app/(pages)/admin/components/PinVerification/index.tsx index 3badb8ed..e22d1c4d 100644 --- a/app/(pages)/admin/components/PinVerification/index.tsx +++ b/app/(pages)/admin/components/PinVerification/index.tsx @@ -1,3 +1,5 @@ +"use client"; + import { useState, useEffect } from "react"; import { Card, Input, Button } from "@nextui-org/react";