]>
Commit | Line | Data |
---|---|---|
a7cf03c1 | 1 | <script lang="ts"> |
be1ce532 RBR |
2 | import type { Topic } from '$lib/data/types'; |
3 | ||
4 | export let topic: Topic; | |
c1bc5993 | 5 | |
58f7d521 | 6 | import { _ } from 'svelte-i18n'; |
a7cf03c1 | 7 | import { readableTime } from '$lib/utils/readable_time'; |
c1bc5993 | 8 | |
852ee620 | 9 | $: remainingTime = new Date(topic.updated_at).getTime() + topic.ttl - Date.now(); |
58f7d521 | 10 | $: remaining = readableTime(remainingTime); |
c1bc5993 RBR |
11 | </script> |
12 | ||
58f7d521 | 13 | <li class="h-entry" title={$_('topic.title')}> |
cac85db0 | 14 | <span class="p-name"> |
6ccc6f60 RBR |
15 | <a |
16 | class="u-url u-uid underline text-blue-600 visited:text-purple-500" | |
17 | title={$_('topic.permalink_title')} | |
18 | href="/t/{topic.id}" | |
19 | > | |
cac85db0 RBR |
20 | {topic.title} |
21 | </a></span | |
22 | > | |
23 | <span class="topic-ttl" | |
24 | >({$_('topic.remaining_time', { | |
58f7d521 | 25 | values: { remaining: $_(remaining.label, { values: { count: remaining.count } }) } |
cac85db0 RBR |
26 | })}) |
27 | </span> | |
c1bc5993 | 28 | </li> |