mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 08:36:44 +00:00
Changes
Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
parent
04b34f9217
commit
adba16e1a7
1 changed files with 22 additions and 2 deletions
|
|
@ -259,7 +259,7 @@ function AgentDetailPage() {
|
|||
isAdmin, hasUser: !!user, hasAgent: !!agent, agentError,
|
||||
});
|
||||
|
||||
if (authLoading || roleLoading) {
|
||||
if (authLoading || (user && roleLoading) || (isAdmin === true && agentLoading)) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center bg-background">
|
||||
<Loader2 className="h-6 w-6 animate-spin text-primary" />
|
||||
|
|
@ -267,7 +267,11 @@ function AgentDetailPage() {
|
|||
);
|
||||
}
|
||||
|
||||
if (!isAdmin) {
|
||||
if (!user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (isAdmin === false) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center bg-background px-4">
|
||||
<div className="max-w-md text-center space-y-4">
|
||||
|
|
@ -285,6 +289,22 @@ function AgentDetailPage() {
|
|||
);
|
||||
}
|
||||
|
||||
if (agentError) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center bg-background px-4">
|
||||
<div className="max-w-md text-center space-y-4">
|
||||
<h1 className="text-2xl font-bold">Erro ao carregar agente</h1>
|
||||
<p className="text-sm text-muted-foreground">{agentError.message}</p>
|
||||
<Button asChild variant="outline">
|
||||
<Link to="/admin">
|
||||
<ArrowLeft className="h-4 w-4 mr-2" /> Voltar ao admin
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (!agent) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center bg-background px-4">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue