Fix chat badge padding and clamp relative time labels
This commit is contained in:
parent
1d3580b187
commit
2ea0952f16
2 changed files with 3 additions and 2 deletions
|
|
@ -281,7 +281,7 @@ export function ChatWidget({ ticketId, ticketRef }: ChatWidgetProps) {
|
||||||
// pointer-events-none no container para que apenas o botao seja clicavel
|
// pointer-events-none no container para que apenas o botao seja clicavel
|
||||||
if (isMinimized) {
|
if (isMinimized) {
|
||||||
return (
|
return (
|
||||||
<div className="pointer-events-none flex h-full w-full items-end justify-end bg-transparent">
|
<div className="pointer-events-none flex h-full w-full items-end justify-end bg-transparent pr-3">
|
||||||
<button
|
<button
|
||||||
onClick={handleExpand}
|
onClick={handleExpand}
|
||||||
className="pointer-events-auto relative flex items-center gap-2 rounded-full bg-black px-4 py-2 text-white shadow-lg hover:bg-black/90"
|
className="pointer-events-auto relative flex items-center gap-2 rounded-full bg-black px-4 py-2 text-white shadow-lg hover:bg-black/90"
|
||||||
|
|
|
||||||
|
|
@ -1018,7 +1018,8 @@ function postureSeverityClass(severity?: string | null) {
|
||||||
function formatRelativeTime(date?: Date | null) {
|
function formatRelativeTime(date?: Date | null) {
|
||||||
if (!date) return "Nunca"
|
if (!date) return "Nunca"
|
||||||
try {
|
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 {
|
} catch {
|
||||||
return "—"
|
return "—"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue