refactor: centralize host route builders and add dedicated new-agent route

This commit is contained in:
Mohamed Boudra
2026-03-04 15:09:06 +07:00
parent 92991ffdb8
commit f47ea7afe5
17 changed files with 231 additions and 193 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ import { BackHeader } from "@/components/headers/back-header";
import { AgentList } from "@/components/agent-list";
import { useAllAgentsList } from "@/hooks/use-all-agents-list";
import { router } from "expo-router";
import { buildHostRootRoute } from "@/utils/host-routes";
export function AgentsScreen({ serverId }: { serverId: string }) {
const { agents, isRevalidating, refreshAll } = useAllAgentsList({
@@ -43,7 +44,7 @@ export function AgentsScreen({ serverId }: { serverId: string }) {
<View style={styles.container}>
<BackHeader
title="All agents"
onBack={() => router.replace(`/h/${encodeURIComponent(serverId)}` as any)}
onBack={() => router.replace(buildHostRootRoute(serverId) as any)}
/>
<AgentList
agents={sortedAgents}