<script>
    import {getContext} from "svelte";
    import SpinnerButton from "../common/SpinnerButton.svelte";
    import SuccessAlert from "../common/SuccessAlert.svelte";

    const channel = getContext("channel");
    let email = "";
    let successAlert;

    function login(e) {
        e.preventDefault();

        axios
            .post(channel.lucentUrl + "/login", {
                email: email,
            })
            .then((response) => {
                
            })
            .catch((error) => {
            });
    }

</script>

<SuccessAlert bind:this={successAlert}/>
<div class="wrapper-tiny">

    <form on:submit={login}>
        <div class="mb-3">
            <label for="emailaddress" class="form-label">Email address</label>
            <input
                type="email"
                bind:value={email}
                class="form-control"
                id="emailaddress"
            />
        </div>


        <div class="text-center mt-5 d-block">
            <SpinnerButton label="Login"/>
        </div>
    </form>

</div>
