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