<script>
import Popup from "$lib/Layout/Popup.svelte";
import Spacer from "$lib/Layout/Spacer.svelte";
import locale from "$stores/locale";
</script>

<Popup locked fullscreen>
  <p><slot /></p>

  <span>{$locale().errors?.animeRateLimited}</span>

  {#await fetch('https://api.waifu.pics/sfw/cry') then response}
    {#await response.json() then json}
      <Spacer />

      <a href={`https://trace.moe/?url=${encodeURIComponent(json.url)}`} target="_blank">
        <img src={json.url} alt="" loading="lazy" decoding="async" style="width: 30vw;" />
      </a>
    {/await}
  {/await}
</Popup>
