]> git.r.bdr.sh - rbdr/forum/blame - src/components/tag/tag.svelte
Allow for conditional reply
[rbdr/forum] / src / components / tag / tag.svelte
CommitLineData
cbe4a5fc
RBR
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}