1 <script lang="ts" context="module">
4 }) => ({ props: { id } });
8 import { onDestroy } from 'svelte';
9 import { _ } from 'svelte-i18n';
10 import { topic } from '$lib/stores/topics';
11 import { disableTopicActions, enableTopicActions } from '$lib/stores/actions';
13 import Topic from '$lib/components/topic/topic.svelte';
14 import ErrorBlock from '$lib/components/error_block/error_block.svelte';
15 import Loader from '$lib/components/loader/loader.svelte';
17 export let id: string;
19 $: response = topic(id, true);
21 enableTopicActions(id);
22 onDestroy(() => disableTopicActions());
26 {#if $response.loading}
27 <title>{$_('loader.message')}, {$_('topic.title')}</title>
30 <title>{$_('error.generic.title')}, {$_('topic.title')}</title>
33 <title>{$response.data.title}, {$_('topic.title')}</title>
37 {#if $response.loading}
41 <ErrorBlock message={$_('topic.error.unavailable')} />
44 <Topic topic={$response.data} />