]> git.r.bdr.sh - rbdr/forum/blame - src/routes/p/[id].svelte
Don't remember what this WIP was about
[rbdr/forum] / src / routes / p / [id].svelte
CommitLineData
cac85db0 1<script lang="ts" context="module">
6ccc6f60 2 export const load = ({ params: { id } }) => ({ props: { id } });
58f7d521
RBR
3</script>
4
cac85db0 5<script lang="ts">
58f7d521 6 import { _ } from 'svelte-i18n';
852ee620 7 import { post } from '$lib/stores/posts';
a7cf03c1
RBR
8 import Post from '$lib/components/post/post.svelte';
9 import ErrorBlock from '$lib/components/error_block/error_block.svelte';
10 import Loader from '$lib/components/loader/loader.svelte';
58f7d521 11
be1ce532 12 export let id: string;
58f7d521 13
852ee620 14 $: postResponse = post(id, true);
58f7d521
RBR
15</script>
16
17<svelte:head>
18 <title>{$_('post.post')}}</title>
19</svelte:head>
20
852ee620 21{#if $postResponse.loading}
58f7d521
RBR
22 <Loader />
23{/if}
852ee620 24{#if $postResponse.error}
58f7d521
RBR
25 <ErrorBlock message={$_('post.error.unavailable')} />
26{/if}
852ee620
RBR
27{#if $postResponse.data}
28 <Post post={$postResponse.data} />
58f7d521 29{/if}