Corrigiu todos os roteamentos

X-Lovable-Edit-ID: edt-8c119a00-7f52-40cf-8fc7-d2bc0ae978fc
Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot] 2026-04-23 21:35:51 +00:00
commit dc0861e561

View file

@ -91,11 +91,12 @@ function AgentDetailPage() {
}, },
}); });
const { data: agent, isLoading: agentLoading } = useQuery({ const { data: agent, isLoading: agentLoading, error: agentError } = useQuery({
queryKey: ["agent-detail", id], queryKey: ["agent-detail", id],
enabled: !!isAdmin, enabled: !!isAdmin,
refetchInterval: 10_000, refetchInterval: 10_000,
queryFn: async () => { queryFn: async () => {
console.log("[admin.agente] fetching agent detail", { id });
const { data, error } = await supabase const { data, error } = await supabase
.from("agent_instances") .from("agent_instances")
.select( .select(
@ -231,7 +232,12 @@ function AgentDetailPage() {
} }
}, [roleLoading, isAdmin, navigate]); }, [roleLoading, isAdmin, navigate]);
if (authLoading || roleLoading || agentLoading) { console.log("[admin.agente] render", {
id, authLoading, roleLoading, agentLoading,
isAdmin, hasUser: !!user, hasAgent: !!agent, agentError,
});
if (authLoading || roleLoading) {
return ( return (
<div className="min-h-screen flex items-center justify-center bg-background"> <div className="min-h-screen flex items-center justify-center bg-background">
<Loader2 className="h-6 w-6 animate-spin text-primary" /> <Loader2 className="h-6 w-6 animate-spin text-primary" />