]> git.r.bdr.sh - rbdr/forum/blob - src/routes/g/[id].svelte
Port to sveltekit
[rbdr/forum] / src / routes / g / [id].svelte
1 <script context="module">
2 export const load = ({
3 page: {
4 params: { id }
5 }
6 }) => ({ props: { id } });
7 </script>
8
9 <script>
10 import { _ } from 'svelte-i18n';
11 import { getTag } from '$/stores/tag';
12 import ErrorBlock from '$/components/error_block/error_block.svelte';
13 import Loader from '$/components/loader/loader.svelte';
14 import Tag from '$/components/tag/tag.svelte';
15 export let id;
16
17 $: store = getTag(id);
18 $: tag = $store.data;
19 </script>
20
21 <svelte:head>
22 <title>{id}, {$_('tag.title')}</title>
23 </svelte:head>
24
25 {#if $store.loading}
26 <Loader />
27 {/if}
28 {#if $store.error}
29 <ErrorBlock message={$_('tag.error.unavailable')} />
30 {/if}
31 {#if tag}
32 <Tag {tag} />
33 {/if}