<script>
  import { push, link } from 'svelte-spa-router';
  import Validator from 'Validator';
  import { onMount } from 'svelte';
  import Layout from '$/client/Layout.svelte';
  import api from "$/client/api.js";

  api.mock({
    "/api/user/profile": {
      "get": [200, {"message": "OK"}],
    }
  });

  onMount(async () => {
    const [status, data] = await api.get("/api/user/profile");

    if(status === 200) {
      console.log("STATUS", status, "DATA", data);
    } else {
      console.error("Invalid response", status, data);
    }
  });
</script>

<style>

</style>

<Layout centered={ true }>
  <h1>Explore</h1>

  <a href="/problems/" use:link>Go here</a>

</Layout>
