]> git.r.bdr.sh - rbdr/forum/blobdiff - src/lib/components/topic_summary/topic_summary.svelte
Use supabase
[rbdr/forum] / src / lib / components / topic_summary / topic_summary.svelte
index 39dad0805234eab1161b3b6808c1f652b0c5456d..d54a195e05e2d4de71ce490a7b1be5f21aabb701 100644 (file)
@@ -1,16 +1,18 @@
 <script lang="ts">
 <script lang="ts">
-       export let topic;
+       import type { Topic } from '$lib/data/types';
+
+       export let topic: Topic;
 
        import { _ } from 'svelte-i18n';
        import { readableTime } from '$lib/utils/readable_time';
 
 
        import { _ } from 'svelte-i18n';
        import { readableTime } from '$lib/utils/readable_time';
 
-       $: remainingTime = topic.updated_at + topic.ttl - Date.now();
+       $: remainingTime = new Date(topic.updated_at).getTime() + topic.ttl - Date.now();
        $: remaining = readableTime(remainingTime);
 </script>
 
 <li class="h-entry" title={$_('topic.title')}>
        <span class="p-name">
        $: 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}">
+               <a class="u-url u-uid underline text-blue-600 visited:text-purple-500" title={$_('topic.permalink_title')} href="/t/{topic.id}">
                        {topic.title}
                </a></span
        >
                        {topic.title}
                </a></span
        >
@@ -20,6 +22,3 @@
                })})
        </span>
 </li>
                })})
        </span>
 </li>
-
-<style>
-</style>