]> git.r.bdr.sh - rbdr/forum/blob - src/components/forum/forum.svelte
7008e6655366b5324fa0b5d9231e86aed2408006
[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 '../error_block/error_block.svelte';
7
8 import TopicSummary from '$components/topic_summary/topic_summary.svelte';
9
10 $: store = getForum(id);
11 $: forum = $store.data;
12 </script>
13
14 {#if $store.loading}
15 <p>Loading...</p>
16 {/if}
17 {#if $store.error}
18 <ErrorBlock message={$_('forum_list.error.unavailable')} />
19 {/if}
20 {#if forum}
21 <h1>{forum.glyph} {$_(forum.label)}</h1>
22 <ul>
23 {#each forum.topics as topic}
24 <TopicSummary topic={topic} />
25 {/each}
26 </ul>
27 {/if}