Fix chat badge padding and clamp relative time labels

This commit is contained in:
rever-tecnologia 2025-12-09 16:38:52 -03:00
parent 1d3580b187
commit 2ea0952f16
2 changed files with 3 additions and 2 deletions

View file

@ -1018,7 +1018,8 @@ function postureSeverityClass(severity?: string | null) {
function formatRelativeTime(date?: Date | null) {
if (!date) return "Nunca"
try {
return formatDistanceToNowStrict(date, { addSuffix: true, locale: ptBR })
const clamped = new Date(Math.min(date.getTime(), Date.now()))
return formatDistanceToNowStrict(clamped, { addSuffix: true, locale: ptBR })
} catch {
return "—"
}