import * as React from 'react'; import { Link, Navigate } from "react-router-dom"; import { useAppDispatch, useAppSelector } from "../../utils/hooks"; import { login } from "../../actions/auth"; import Avatar from '@mui/material/Avatar'; import Button from '@mui/material/Button'; import CssBaseline from '@mui/material/CssBaseline'; import TextField from '@mui/material/TextField'; import Box from '@mui/material/Box'; import LockOutlinedIcon from '@mui/icons-material/LockOutlined'; import Typography from '@mui/material/Typography'; import Container from '@mui/material/Container'; export default function Login() { const dispatch = useAppDispatch(); const isAuthenticated = useAppSelector((state) => state.auth.isAuthenticated); const handleSubmit = (event: React.FormEvent) => { event.preventDefault(); const data = new FormData(event.currentTarget); const email = data.get('email') as string const password = data.get('pasword') as string if (email && password) dispatch(login(email, password)); }; if (isAuthenticated) { return ; } return ( Log In

Don't have an account? Sign Up

); }