4 import { _ } from 'svelte-i18n';
5 import Post from '$lib/components/post/post.svelte';
6 import { readableTime } from '$lib/utils/readable_time';
8 $: remainingTime = topic.updated_at + topic.ttl - Date.now();
9 $: remaining = readableTime(remainingTime);
12 <div class="h-entry" title={$_('topic.title')}>
13 <h1 class="p-name">{topic.title}</h1>
14 <aside class="topic-meta" title={$_('topic.metadata_title')}>
16 <span class="topic-location">
17 {$_('topic.category_location')}
18 <a href="/f/{topic.forum.id}" class="p-category">
20 {$_(topic.forum.label)}
24 <span class="topic-ttl">
25 <a class="u-url u-uid" title={$_('topic.permalink_title')} href="/t/{topic.id}">
26 ({$_('topic.remaining_time', {
27 values: { remaining: $_(remaining.label, { values: { count: remaining.count } }) }
32 {#if topic.tags.length > 0}
33 <aside class="topic-tags" title={$_('topic.tags_title')}>
34 {$_('topic.tags_location')}
35 {#each topic.tags as tag}
36 <a href="/g/{tag.id}" class="p-category">
37 {tag.id}<span class="tag-weight">({tag.weight})</span>
42 {#each topic.posts as post, index}
43 <Post {post} {index} count={topic.posts.length} />