Corrige fallback HTML e consulta tickets por canal

This commit is contained in:
Esdras Renan 2025-11-14 19:56:47 -03:00
parent 15d11b6b12
commit 11a4b903c4
2 changed files with 10 additions and 2 deletions

View file

@ -63,6 +63,16 @@ function getInitials(name: string | null | undefined, fallback: string): string
return normalizedFallback.length > 0 ? normalizedFallback.charAt(0).toUpperCase() : "?"
}
function toHtml(text: string) {
const escaped = text
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;")
return `<p>${escaped.replace(/\n/g, "<br />")}</p>`
}
type RequesterPreviewProps = {
customer: CustomerOption | null
company: { id: string; name: string; isAvulso?: boolean } | null