]> git.r.bdr.sh - rbdr/forum/blame - src/components/post/post.svelte
Add tag component:
[rbdr/forum] / src / components / post / post.svelte
CommitLineData
24be7b53 1<script>
c458f273
RBR
2 export let id;
3
bd8e98d7
RBR
4 import { _ } from 'svelte-i18n';
5
c458f273
RBR
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';
24be7b53 10
c458f273
RBR
11 $: store = getPost(id);
12 $: post = $store.data;
13</script>
24be7b53 14
c458f273
RBR
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}