]>
Commit | Line | Data |
---|---|---|
cac85db0 | 1 | <script lang="ts" context="module"> |
58f7d521 | 2 | export const load = ({ |
852ee620 | 3 | params: { id } |
58f7d521 RBR |
4 | }) => ({ props: { id } }); |
5 | </script> | |
6 | ||
cac85db0 | 7 | <script lang="ts"> |
58f7d521 | 8 | import { _ } from 'svelte-i18n'; |
852ee620 | 9 | import { topicsForTag } from '$lib/stores/topics'; |
a7cf03c1 RBR |
10 | import ErrorBlock from '$lib/components/error_block/error_block.svelte'; |
11 | import Loader from '$lib/components/loader/loader.svelte'; | |
12 | import Tag from '$lib/components/tag/tag.svelte'; | |
be1ce532 | 13 | export let id: string; |
58f7d521 | 14 | |
852ee620 | 15 | $: tagResponse = topicsForTag(id); |
58f7d521 RBR |
16 | </script> |
17 | ||
18 | <svelte:head> | |
19 | <title>{id}, {$_('tag.title')}</title> | |
20 | </svelte:head> | |
21 | ||
852ee620 | 22 | {#if $tagResponse.loading} |
58f7d521 RBR |
23 | <Loader /> |
24 | {/if} | |
852ee620 | 25 | {#if $tagResponse.error} |
58f7d521 RBR |
26 | <ErrorBlock message={$_('tag.error.unavailable')} /> |
27 | {/if} | |
852ee620 RBR |
28 | {#if $tagResponse.data} |
29 | <Tag topics={$tagResponse.data} tag={id} /> | |
58f7d521 | 30 | {/if} |