add CommentCount

This commit is contained in:
Yusur 2025-10-23 12:57:04 +02:00
parent 11deee34a7
commit da1c2809d9
3 changed files with 36 additions and 2 deletions

View file

@ -12,13 +12,14 @@
import { SvelteShowdown } from "svelte-showdown";
import VoteButton from "./VoteButton.svelte";
import { getMe } from "./globals.svelte";
import CommentCount from "./CommentCount.svelte";
let { post }: { post: PostEntry } = $props();
let me = getMe();
let { title, id, content = '', to, votes, my_vote } = post;
let { title, id, content = '', to, votes, my_vote, comment_count } = post;
</script>
<SLayout title={to.display_name + (to.type === 'guild' ? ` (+${to.name})` : to.type === 'user' ? ` (@${to.username})` : '')}>
@ -37,6 +38,7 @@ let { title, id, content = '', to, votes, my_vote } = post;
<aside class="message-stats">
<!-- upvotes / downvotes -->
<VoteButton score={votes} vote={my_vote} {id} />
<CommentCount count={comment_count} />
</aside>
<ul class="message-options row">
{#if me && me.id !== post.author?.id}
@ -49,6 +51,8 @@ let { title, id, content = '', to, votes, my_vote } = post;
</div>
</article>
{#snippet left()}
{#if to.type === 'guild'}
<GuildMenu guild={to} />