]> git.r.bdr.sh - rbdr/forum/blob - src/routes/g/[id].svelte
2033f14344a2041711bf8b444feb0b7173bb1ae7
[rbdr/forum] / src / routes / g / [id].svelte
1 <script lang="ts" context="module">
2 export const load = ({
3 params: { id }
4 }) => ({ props: { id } });
5 </script>
6
7 <script lang="ts">
8 import { _ } from 'svelte-i18n';
9 import { topicsForTag } from '$lib/stores/topics';
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';
13 export let id: string;
14
15 $: tagResponse = topicsForTag(id);
16 </script>
17
18 <svelte:head>
19 <title>{id}, {$_('tag.title')}</title>
20 </svelte:head>
21
22 {#if $tagResponse.loading}
23 <Loader />
24 {/if}
25 {#if $tagResponse.error}
26 <ErrorBlock message={$_('tag.error.unavailable')} />
27 {/if}
28 {#if $tagResponse.data}
29 <Tag topics={$tagResponse.data} tag={id} />
30 {/if}