feat: automações de tickets e testes de regressão
This commit is contained in:
parent
9f1a6a7401
commit
8ab510bfe9
18 changed files with 2221 additions and 20 deletions
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
import dynamic from "next/dynamic"
|
||||
import { api } from "@/convex/_generated/api"
|
||||
import { useAuth } from "@/lib/auth-client"
|
||||
import { isAgentOrAdmin } from "@/lib/authz"
|
||||
|
||||
// Verifica se a API do liveChat existe
|
||||
function checkLiveChatApiExists() {
|
||||
|
|
@ -19,6 +21,11 @@ const ChatWidget = dynamic(
|
|||
)
|
||||
|
||||
export function ChatWidgetProvider() {
|
||||
const { role, isLoading } = useAuth()
|
||||
|
||||
if (isLoading) return null
|
||||
if (!isAgentOrAdmin(role)) return null
|
||||
|
||||
// Nao renderiza se a API nao existir (Convex nao sincronizado)
|
||||
if (!checkLiveChatApiExists()) {
|
||||
return null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue