mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-06-05 20:15:31 -04:00
refactor: simplify next link component usage
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user