<template>
  <div class="post">
    <div class="container">
      <div
          class="post__wrapper"
          v-if="post.content && !pending"
          v-html="post.content"
      />
      <skeletons-docs v-else />
    </div>
  </div>
</template>

<script setup lang="ts">
import {usePostBySlug} from "@composables/posts";
import {usePageTitle} from "@composables/utils";

const {t} = useI18n();

const postSlug = useRouteParams<string>('slug');

const { setPageTitle } = usePageTitle();
const { post, pending } = await usePostBySlug(postSlug.value);

setPageTitle(post.value?.title ? post.value?.title : t('breadcrumbs.blog'));
</script>

<style lang="scss" scoped>
.post {
  padding-block: 50px 100px;
}
</style>