<script>
    export let article_id;
    const Article = (async () => {
    const response = await fetch('/api/article/' + article_id + '/get')
    return await response.json()
	})()
    console.log(Article)
</script>

<div class="mockup-window border bg-base-300">
    <h1 class="center">Article overview</h1>
    <ul tabindex="0" class="menu p-2 shadow bg-base-100 rounded-box w-52">
        {#await Article}
            <li>...waiting</li>
        {:then data}
            <li><a href="#">{data.value}</a></li>
            <li><a href="#">Item 2</a></li>
        {:catch error}
            <li>An error occurred!</li>
        {/await}
    
        
    </ul>
    
</div>