]> git.r.bdr.sh - rbdr/forum/blob - src/routes/f/[id].svelte
Add typedoc
[rbdr/forum] / src / routes / f / [id].svelte
1 <script lang="ts" context="module">
2 export const load = ({
3 page: {
4 params: { id }
5 }
6 }) => ({ props: { id } });
7 </script>
8
9 <script lang="ts">
10 import { _ } from 'svelte-i18n';
11 import Forum from '$lib/components/forum/forum.svelte';
12 import ErrorBlock from '$lib/components/error_block/error_block.svelte';
13 import Loader from '$lib/components/loader/loader.svelte';
14
15 export let id: string;
16
17 import { getForum } from '$lib/stores/forums';
18 $: store = getForum(id);
19 $: forum = $store.data;
20 </script>
21
22 <svelte:head>
23 <title>{$_(`forum.name.${id}`)}, {$_('forum.forum')}</title>
24 </svelte:head>
25
26 {#if $store.loading}
27 <Loader />
28 {/if}
29 {#if $store.error}
30 <ErrorBlock message={$_('forum.error.unavailable')} />
31 {/if}
32 {#if forum}
33 <Forum {forum} />
34 {/if}