]>
Commit | Line | Data |
---|---|---|
1 | <script> | |
2 | export let id; | |
3 | ||
4 | import { _ } from 'svelte-i18n'; | |
5 | ||
6 | import { getPost } from '$/stores/post'; | |
7 | import PostContent from '$/components/post_content/post_content.svelte'; | |
8 | import ErrorBlock from '$/components/error_block/error_block.svelte'; | |
9 | import Loader from '$/components/loader/loader.svelte'; | |
10 | ||
11 | $: store = getPost(id); | |
12 | $: post = $store.data; | |
13 | </script> | |
14 | ||
15 | {#if $store.loading} | |
16 | <Loader /> | |
17 | {/if} | |
18 | {#if $store.error} | |
19 | <ErrorBlock message={$_('post.error.unavailable')} /> | |
20 | {/if} | |
21 | {#if post} | |
22 | <PostContent post={post} /> | |
23 | {/if} |