Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot] 2026-04-17 20:00:56 +00:00
parent 75397543e8
commit bebe095d6e
4 changed files with 188 additions and 2 deletions

View file

@ -7,8 +7,14 @@ import { useAuth } from "@/hooks/use-auth";
export interface AgentInstance {
id: string;
user_id: string;
uuid_tenant: string;
status: string;
telegram_bot_username: string | null;
telegram_webhook_configured: boolean;
telegram_token_invalid: boolean;
telegram_first_message_received_at: string | null;
telegram_connected_at: string | null;
telegram_onboarding_completed: boolean;
created_at: string;
}
@ -20,11 +26,13 @@ export function useAgentInstance() {
queryFn: async (): Promise<AgentInstance | null> => {
const { data, error } = await supabase
.from("agent_instances")
.select("id, user_id, status, telegram_bot_username, created_at")
.select(
"id, user_id, uuid_tenant, status, telegram_bot_username, telegram_webhook_configured, telegram_token_invalid, telegram_first_message_received_at, telegram_connected_at, telegram_onboarding_completed, created_at",
)
.eq("user_id", user!.id)
.maybeSingle();
if (error) throw error;
return data;
return data as AgentInstance | null;
},
});
}