<script setup>
import TableHeader from '~/components/parts/TableHeader.vue';

const slug = useRoute().params.slug;
const { locale } = useI18n();

const { data: post } = await useAsyncData(`art-${slug}`, () => 
  queryCollection(`art`).path(`/art/${locale.value}/${slug}`).first()
, {watch: [locale]})
</script>

<template>
  <!-- Render the blog post as Prose & Vue components -->
  <div class="no-sprite">
      <TableHeader></TableHeader>
    </div>
  <div class="extended-container">
    <ContentRenderer v-if="post" :value="post" class="art" />
  </div>
</template>

<style lang="scss">
.extended-container {
    width: 100%;
    margin: auto;
    margin-top: 32px;
}

.art {
    h2 {
        a {
            text-decoration: none;
            color: var(--color-text);
        }   
    }

    img {
        margin: auto;
        display: flex;
        max-height: 77vh;
        max-width: 100%;
    }
}
</style>

<style lang="scss">
.no-sprite .undertable-wrapper {
  display: none;
}
</style>