]> git.r.bdr.sh - rbdr/forum/blame - src/lib/components/topic_summary/topic_summary.svelte
Update / use typescript
[rbdr/forum] / src / lib / components / topic_summary / topic_summary.svelte
CommitLineData
a7cf03c1 1<script lang="ts">
58f7d521 2 export let topic;
c1bc5993 3
58f7d521 4 import { _ } from 'svelte-i18n';
a7cf03c1 5 import { readableTime } from '$lib/utils/readable_time';
c1bc5993 6
58f7d521
RBR
7 $: remainingTime = topic.updated_at + topic.ttl - Date.now();
8 $: remaining = readableTime(remainingTime);
c1bc5993
RBR
9</script>
10
58f7d521 11<li class="h-entry" title={$_('topic.title')}>
47b0bfe4
RBR
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 <span class="topic-ttl">({$_('topic.remaining_time', {
58f7d521 17 values: { remaining: $_(remaining.label, { values: { count: remaining.count } }) }
47b0bfe4
RBR
18 })})
19 </span>
c1bc5993
RBR
20</li>
21
22<style>
23</style>