<script context="module">
 import { getWork } from '$lib/works';

 export async function load({ params, stuff }) {
     const work = getWork(params.wid);

     return {
         props: {
             work,
         },
         stuff: {
             ...stuff,
             work,
         }
     };
 }
</script>

<script lang="ts">

 export let work;
</script>

{#await work}
    <div class="text-center">
        <div class="spinner-border text-primary mx-3" role="status"></div>
        <span>Chargement du rendu &hellip;</span>
    </div>
{:then}
    <slot></slot>
{:catch error}
    <div class="text-center">
        <h2>
            <a href="works/" class="text-muted" style="text-decoration: none">&lt;</a>
            Travail introuvable
        </h2>
        <span>{error}</span>
    </div>
{/await}
