2024-08-16 13:42:51 +00:00
|
|
|
<template>
|
|
|
|
<div class="my-2">
|
|
|
|
<div v-if="status == 'pending'">{{ t("loading") }}</div>
|
|
|
|
<post-item v-else class="no-margin-post" :post="post" :force-show-content="props.forceShowContent" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
import PostItem from "~/components/PostItem.vue"
|
|
|
|
|
|
|
|
const props = defineProps<{ id: number, forceShowContent?: boolean }>()
|
|
|
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
|
|
const config = useRuntimeConfig()
|
|
|
|
|
2024-08-17 15:56:03 +00:00
|
|
|
const { status, data: post } = await useFetch<any>(`${config.public.solarNetworkApi}/cgi/co/posts/${props.id}`)
|
2024-08-16 13:42:51 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.no-margin-post {
|
|
|
|
margin: 0 !important;
|
|
|
|
}
|
|
|
|
</style>
|