diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-03-13 15:28:29 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-03-13 15:28:29 +0100 |
| commit | c1bc5993a694f6fd047a3881351827058042483b (patch) | |
| tree | 3d64130e1e6a2f86f70981df28cf22cd535bf2b2 /src/components/topic_summary | |
| parent | bd8e98d7e24c4dbaee7db6ec7955f7c2f6d396a6 (diff) | |
Use routify and GraphQL server
Diffstat (limited to 'src/components/topic_summary')
| -rw-r--r-- | src/components/topic_summary/topic_summary.svelte | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/components/topic_summary/topic_summary.svelte b/src/components/topic_summary/topic_summary.svelte new file mode 100644 index 0000000..deef3e2 --- /dev/null +++ b/src/components/topic_summary/topic_summary.svelte @@ -0,0 +1,17 @@ +<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> |