]> git.r.bdr.sh - rbdr/forum/blob - src/lib/components/topic_summary/topic_summary.svelte
39dad0805234eab1161b3b6808c1f652b0c5456d
[rbdr/forum] / src / lib / components / topic_summary / topic_summary.svelte
1 <script lang="ts">
2 export let topic;
3
4 import { _ } from 'svelte-i18n';
5 import { readableTime } from '$lib/utils/readable_time';
6
7 $: remainingTime = topic.updated_at + topic.ttl - Date.now();
8 $: remaining = readableTime(remainingTime);
9 </script>
10
11 <li class="h-entry" title={$_('topic.title')}>
12 <span class="p-name">
13 <a class="u-url u-uid" title={$_('topic.permalink_title')} href="/t/{topic.id}">
14 {topic.title}
15 </a></span
16 >
17 <span class="topic-ttl"
18 >({$_('topic.remaining_time', {
19 values: { remaining: $_(remaining.label, { values: { count: remaining.count } }) }
20 })})
21 </span>
22 </li>
23
24 <style>
25 </style>