import React from "react"; import Cookies from "js-cookie"; import { logout, loginUser } from "../utils/userHandler"; type LoginCardProps = { onClose: () => void; }; const LoginCard: React.FC = ({ onClose }) => { return (

Login

{ event.preventDefault(); const formData = new FormData(event.currentTarget); const username = formData.get("username"); const password = formData.get("password"); loginUser(username as string, password as string); }} className="space-y-4 text-black dark:text-white" >
{Cookies.get("name") ? (

) : ( )}
{Cookies.get("name") ? ( ) : (

Don't have an account?{" "} Register here

)}
); }; export default LoginCard;