1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-06-05 20:15:31 -04:00
Files
jarv.is/components/comment-count.tsx
T

17 lines
466 B
TypeScript

import { env } from "@/lib/env";
import { getCommentCounts } from "@/lib/server/comments";
const CommentCount = async ({ slug }: { slug: string }) => {
const count = await getCommentCounts(slug);
return (
<span
title={`${Intl.NumberFormat(env.NEXT_PUBLIC_SITE_LOCALE).format(count)} ${count === 1 ? "comment" : "comments"}`}
>
{Intl.NumberFormat(env.NEXT_PUBLIC_SITE_LOCALE).format(count)}
</span>
);
};
export default CommentCount;