]> git.r.bdr.sh - rbdr/forum/blob - src/components/forum/forum.svelte
8fc0538327f91a241b6481aa1233602c38a07b58
[rbdr/forum] / src / components / forum / forum.svelte
1 <script>
2 export let id;
3
4 import { _ } from 'svelte-i18n';
5 import { getForum } from '$/stores/forum';
6 import ErrorBlock from '$/components/error_block/error_block.svelte';
7 import Loader from '$/components/loader/loader.svelte';
8
9 import TopicSummary from '$/components/topic_summary/topic_summary.svelte';
10
11 $: store = getForum(id);
12 $: forum = $store.data;
13 </script>
14
15 {#if $store.loading}
16 <Loader />
17 {/if}
18 {#if $store.error}
19 <ErrorBlock message={$_('forum.error.unavailable')} />
20 {/if}
21 {#if forum}
22 <h1>{forum.glyph} {$_(forum.label)}</h1>
23 <ul>
24 {#each forum.topics as topic}
25 <TopicSummary topic={topic} />
26 {/each}
27 </ul>
28 {/if}