aboutsummaryrefslogtreecommitdiff
path: root/src/components/topic_summary/topic_summary.svelte
blob: 5f2678b7d711a6ea5495966e821991133ded9b0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<script>
	export let topic;

	import { _ } from 'svelte-i18n';
	import { readableTime } from '$/utils/readable_time.js';

	$: remainingTime = topic.updated_at + topic.ttl - Date.now();
	$: remaining = readableTime(remainingTime);
</script>

<li class="h-entry" title={$_('topic.title')}>
	<span class="p-name"
		><a class="u-url u-uid" title={$_('topic.permalink_title')} href="/t/{topic.id}"
			>{topic.title}</a
		></span
	>
	<span class="topic-ttl"
		>({$_('topic.remaining_time', {
			values: { remaining: $_(remaining.label, { values: { count: remaining.count } }) }
		})})</span
	>
</li>

<style>
</style>