]>
Commit | Line | Data |
---|---|---|
cac85db0 | 1 | <script lang="ts" context="module"> |
58f7d521 | 2 | export const load = ({ |
cac85db0 RBR |
3 | page: { |
4 | params: { id } | |
5 | } | |
58f7d521 RBR |
6 | }) => ({ props: { id } }); |
7 | </script> | |
8 | ||
cac85db0 | 9 | <script lang="ts"> |
58f7d521 | 10 | import { _ } from 'svelte-i18n'; |
a7cf03c1 RBR |
11 | import { getPost } from '$lib/stores/posts'; |
12 | import Post from '$lib/components/post/post.svelte'; | |
13 | import ErrorBlock from '$lib/components/error_block/error_block.svelte'; | |
14 | import Loader from '$lib/components/loader/loader.svelte'; | |
58f7d521 | 15 | |
be1ce532 | 16 | export let id: string; |
58f7d521 RBR |
17 | |
18 | $: store = getPost(id); | |
19 | $: post = $store.data; | |
20 | </script> | |
21 | ||
22 | <svelte:head> | |
23 | <title>{$_('post.post')}}</title> | |
24 | </svelte:head> | |
25 | ||
26 | {#if $store.loading} | |
27 | <Loader /> | |
28 | {/if} | |
29 | {#if $store.error} | |
30 | <ErrorBlock message={$_('post.error.unavailable')} /> | |
31 | {/if} | |
32 | {#if post} | |
33 | <Post {post} /> | |
34 | {/if} |