From c1bc5993a694f6fd047a3881351827058042483b Mon Sep 17 00:00:00 2001
From: Ruben Beltran del Rio <ruben@unlimited.pizza>
Date: Sat, 13 Mar 2021 15:28:29 +0100
Subject: Use routify and GraphQL server

---
 src/components/topic_summary/topic_summary.svelte | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 src/components/topic_summary/topic_summary.svelte

(limited to 'src/components/topic_summary/topic_summary.svelte')

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>
-- 
cgit 

