1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-11-14 23:00:49 -05:00

have hit counter start at zero during suspense, then count up

This commit is contained in:
2025-03-27 10:08:18 -04:00
parent bbf6e9dc66
commit 0080c4925b
8 changed files with 40 additions and 5 deletions

View File

@@ -128,7 +128,11 @@ const Page = async ({ params }: { params: Promise<{ slug: string }> }) => {
}}
>
<EyeIcon size="1.2em" className={styles.metaIcon} />
<Suspense fallback={<Loading boxes={3} width={20} />}>
<Suspense
// when this loads, the component will count up from zero to the actual number of hits, so we can simply
// show a zero here as a "loading indicator"
fallback={<span>0</span>}
>
<HitCounter slug={`notes/${frontmatter!.slug}`} />
</Suspense>
</div>