import React from 'react'
import Grid from '@mui/material/Grid2';
import { Box, Button, TextField, Link } from '@mui/material'

const LoginForm = () => {

    const handleSubmit = (e) => {
        e.preventDefault();
        // Handle form submission logic
        console.log('Form submitted');
      };

    return (
        <Grid>
            <Box
                component="form"
                onSubmit={handleSubmit}
                sx={{
                    width: '100%',
                    maxWidth: 400,
                    mx: 'auto',
                    mt: 4,
                    display: 'flex',
                    flexDirection: 'column',
                    gap: 4,
                }}
            >

                <TextField
                    label="Email"
                    type="email"
                    variant="outlined"
                    fullWidth
                    required
                />

                <TextField
                    label="Password"
                    type="password"
                    variant="outlined"
                    fullWidth
                    required
                />

                <Link>Forgot Password?</Link>

                <Button
                    variant="contained"
                    color="common.black"
                    onClick={() => { window.location.href = "/checkout" }}
                    sx={{
                        backgroundColor: (theme) => theme.palette.common.black,
                        color: "white",
                        textTransform: "none",
                        mx: "auto",
                        px: 8,
                        py: 2,
                        width: "fit-content",
                        "&:hover": {
                            backgroundColor: (theme) => theme.palette.grey[900],
                        },
                    }}>SIGN IN</Button>

            </Box>
        </Grid>
    )
}

export default LoginForm