From adba16e1a7c334b160b96c4bb986f993f41eeb83 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Thu, 23 Apr 2026 21:47:11 +0000 Subject: [PATCH] Changes Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com> --- src/routes/admin.agente.$id.tsx | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/routes/admin.agente.$id.tsx b/src/routes/admin.agente.$id.tsx index 39f3428..461032e 100644 --- a/src/routes/admin.agente.$id.tsx +++ b/src/routes/admin.agente.$id.tsx @@ -259,7 +259,7 @@ function AgentDetailPage() { isAdmin, hasUser: !!user, hasAgent: !!agent, agentError, }); - if (authLoading || roleLoading) { + if (authLoading || (user && roleLoading) || (isAdmin === true && agentLoading)) { return (
@@ -267,7 +267,11 @@ function AgentDetailPage() { ); } - if (!isAdmin) { + if (!user) { + return null; + } + + if (isAdmin === false) { return (
@@ -285,6 +289,22 @@ function AgentDetailPage() { ); } + if (agentError) { + return ( +
+
+

Erro ao carregar agente

+

{agentError.message}

+ +
+
+ ); + } + if (!agent) { return (