]> git.r.bdr.sh - rbdr/forum/blame - src/components/topic_summary/topic_summary.svelte
Add tests for first batch of components
[rbdr/forum] / src / components / topic_summary / topic_summary.svelte
CommitLineData
c1bc5993 1<script>
58f7d521 2 export let topic;
c1bc5993 3
58f7d521
RBR
4 import { _ } from 'svelte-i18n';
5 import { readableTime } from '$/utils/readable_time.js';
c1bc5993 6
58f7d521
RBR
7 $: remainingTime = topic.updated_at + topic.ttl - Date.now();
8 $: remaining = readableTime(remainingTime);
c1bc5993
RBR
9</script>
10
58f7d521
RBR
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}</a
15 ></span
16 >
17 <span class="topic-ttl"
18 >({$_('topic.remaining_time', {
19 values: { remaining: $_(remaining.label, { values: { count: remaining.count } }) }
20 })})</span
21 >
c1bc5993
RBR
22</li>
23
24<style>
25</style>