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
|
||||
if (isMinimized) {
|
||||
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
|
||||
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"
|
||||
|
|
|
|||
|
|
@ -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 "—"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue