Make profile formatting hydration-safe

This commit is contained in:
test
2026-08-30 09:28:07 +02:00
parent 5db36cb29f
commit 71972afb87
9 changed files with 44 additions and 60 deletions
@@ -1,17 +1,11 @@
import React from 'react'
import { formatProfileDate, formatProfileNumber } from '../../../lib/profileFormatters'
function formatFollowedAt(value) {
if (!value) return null
try {
const date = new Date(value)
if (Number.isNaN(date.getTime())) return null
return date.toLocaleDateString(undefined, {
year: 'numeric',
month: 'short',
day: 'numeric',
})
return formatProfileDate(value, { year: 'numeric', month: 'short', day: 'numeric' })
} catch {
return null
}
@@ -36,7 +30,7 @@ export default function TabFollowers({ listing, username, followerCount }) {
<i className="fa-solid fa-users text-sky-400 fa-fw" />
Followers
<span className="rounded bg-white/5 px-1.5 py-0.5 text-[10px] font-medium normal-case tracking-normal text-slate-400">
{total.toLocaleString()}
{formatProfileNumber(total)}
</span>
</h2>