diff --git a/.gitignore b/.gitignore index 043f2941..4fd1ef9e 100644 --- a/.gitignore +++ b/.gitignore @@ -60,6 +60,7 @@ offline-backend-20260512/skills/ offline-backend-20260512/wheelhouse/ offline-backend-20260512/backend/.deer-flow/data/*.db offline-backend-20260512/backend/.deer-flow/data/*.db-* +offline-backend-20260512/backend/.deer-flow/* offline-backend-20260512/start_backend.sh offline-backend-20260512/stop_backend.sh offline-backend-20260512/check_backend.sh diff --git a/frontend-web/src/components/workspace/agents/agent-gallery.tsx b/frontend-web/src/components/workspace/agents/agent-gallery.tsx index a8e14376..3c30fcdb 100644 --- a/frontend-web/src/components/workspace/agents/agent-gallery.tsx +++ b/frontend-web/src/components/workspace/agents/agent-gallery.tsx @@ -2,9 +2,12 @@ import { BotIcon, PlusIcon } from "lucide-react"; import { useRouter } from "next/navigation"; +import { useMemo, useState } from "react"; import { Button } from "@/components/ui/button"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { useAgents } from "@/core/agents"; +import { getStoredAuth } from "@/core/auth"; import { useI18n } from "@/core/i18n/hooks"; import { AgentCard } from "./agent-card"; @@ -13,11 +16,51 @@ export function AgentGallery() { const { t } = useI18n(); const { agents, isLoading } = useAgents(); const router = useRouter(); + const [activeTab, setActiveTab] = useState<"all" | "mine">("all"); + + const storedAuth = useMemo(() => getStoredAuth(), []); + const currentUserId = storedAuth?.user_id ?? null; + + const allAgents = useMemo( + () => agents.filter((a) => a.builtin || a.published), + [agents], + ); + + const myAgents = useMemo( + () => agents.filter((a) => a.user_id !== null && a.user_id === currentUserId), + [agents, currentUserId], + ); const handleNewAgent = () => { router.push("/page/workspace/agents/new"); }; + const renderGrid = (list: typeof agents) => ( +
{t.agents.emptyTitle}
+{description}
+{t.agents.emptyTitle}
-- {t.agents.emptyDescription} -
+ ) : allAgents.length === 0 ? ( + renderEmpty(t.agents.emptyDescription) + ) : ( + renderGrid(allAgents) + )} + + +