Skip to content

Commit

Permalink
Refactor useAgents and add testFlask to Home
Browse files Browse the repository at this point in the history
  • Loading branch information
truemiller committed Feb 6, 2024
1 parent c2831c3 commit 991bfd9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
4 changes: 2 additions & 2 deletions frontend/hooks/useAgents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const useAgents = () => {
const response = await fetch("/api/test");
const data = await response.json();
console.log(data);
}
}

const updateAgents = async () => {
console.log("Updating agents");
Expand All @@ -32,5 +32,5 @@ export const useAgents = () => {
return data;
};

return { startAgent, agents, updateAgents, stopAgent };
return { startAgent, agents, updateAgents, stopAgent, testFlask };
};
40 changes: 21 additions & 19 deletions frontend/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
import { Layout } from "@/components/Layout/Layout";
import { Marketplace } from "@/components/Marketplace/Marketplace";
import { YourAgents } from "@/components/YourAgents/YourAgents";
import { useAgents } from "@/hooks/useAgents";
import { useTabs } from "@/hooks/useTabs";
import { Button, Tabs, type TabsProps } from "antd";
import { useMemo } from "react";



export default function Home() {

const tabs: TabsProps["items"] = useMemo(()=>[
{
key: "1",
label: "Your Agents",
children: <YourAgents />,
},
{
key: "2",
label: "Marketplace",
children: <Marketplace />,
},
{
key: "3",
label: "Test",
children: <Button />,
}
],[]);


const { activeTab, setActiveTab } = useTabs();
const { testFlask } = useAgents();

const tabs: TabsProps["items"] = useMemo(() => [
{
key: "1",
label: "Your Agents",
children: <YourAgents />,
},
{
key: "2",
label: "Marketplace",
children: <Marketplace />,
},
{
key: "3",
label: "Test",
children: <Button />,
}
], []);



Expand Down

0 comments on commit 991bfd9

Please sign in to comment.