From d4b5498422f36622d18b4ae6b82a389688a20591 Mon Sep 17 00:00:00 2001 From: Biwas Bhandari Date: Sat, 2 Nov 2024 10:28:44 +0545 Subject: [PATCH 1/6] fix(clone): clone button disabled for 2 sec --- src/components/crews/CloneTradingAnalyzer.tsx | 82 ++++++++++--------- src/components/dashboard/Dashboard.tsx | 21 ++++- 2 files changed, 62 insertions(+), 41 deletions(-) diff --git a/src/components/crews/CloneTradingAnalyzer.tsx b/src/components/crews/CloneTradingAnalyzer.tsx index dccd729f..754ca1ef 100644 --- a/src/components/crews/CloneTradingAnalyzer.tsx +++ b/src/components/crews/CloneTradingAnalyzer.tsx @@ -16,44 +16,44 @@ const getDefaultAgents = async (): Promise => { const webSearchTools = await getToolsByCategory("web_search"); return [ - { - name: "Research agent for ALEX", - role: "Market Researcher", - goal: "Analyze and provide insights on market trends using ALEX data", - backstory: - "Specialized in processing and analyzing ALEX market data to identify trading opportunities and market patterns", - agent_tools: [ - ...alexTools.map((t) => t.id), - ...webSearchTools.map((t) => t.id), - ], - }, - { - name: "Research agent for bitflow", - role: "Bitflow Analyst", - goal: "Monitor and analyze Bitflow trading signals and market data", - backstory: - "Expert in interpreting Bitflow signals and correlating them with market movements", - agent_tools: [ - ...bitflowTools.map((t) => t.id), - ...webSearchTools.map((t) => t.id), - ], - }, - { - name: "Research agent for lunarcrush", - role: "Social Sentiment Analyst", - goal: "Track and analyze social sentiment data from LunarCrush", - backstory: - "Specialized in social media sentiment analysis and its correlation with crypto markets", - agent_tools: [...lunarcrushTools.map((t) => t.id)], - }, - { - name: "Trade executor for bitflow", - role: "Trade Executor", - goal: "Execute trades based on analyzed signals and market conditions", - backstory: - "Experienced in implementing trading strategies and managing trade execution", - agent_tools: [...bitflowTools.map((t) => t.id)], - }, + { + name: "Research agent for ALEX", + role: "Market Researcher", + goal: "Analyze and provide insights on market trends using ALEX data", + backstory: + "Specialized in processing and analyzing ALEX market data to identify trading opportunities and market patterns", + agent_tools: [ + ...alexTools.map((t) => t.id), + ...webSearchTools.map((t) => t.id), + ], + }, + { + name: "Research agent for bitflow", + role: "Bitflow Analyst", + goal: "Monitor and analyze Bitflow trading signals and market data", + backstory: + "Expert in interpreting Bitflow signals and correlating them with market movements", + agent_tools: [ + ...bitflowTools.map((t) => t.id), + ...webSearchTools.map((t) => t.id), + ], + }, + { + name: "Research agent for lunarcrush", + role: "Social Sentiment Analyst", + goal: "Track and analyze social sentiment data from LunarCrush", + backstory: + "Specialized in social media sentiment analysis and its correlation with crypto markets", + agent_tools: [...lunarcrushTools.map((t) => t.id)], + }, + { + name: "Trade executor for bitflow", + role: "Trade Executor", + goal: "Execute trades based on analyzed signals and market conditions", + backstory: + "Experienced in implementing trading strategies and managing trade execution", + agent_tools: [...bitflowTools.map((t) => t.id)], + }, ]; }; @@ -95,10 +95,12 @@ const createTaskForAgent = (agent: CloneAgent): CloneTask => { interface CloneTradingAnalyzerProps { onCloneComplete: () => void; + disabled: boolean; } -export function CloneTradingAnalyzer({ +export function CloneTradingAnalyzer({ onCloneComplete, + disabled, }: CloneTradingAnalyzerProps) { const [isCloning, setIsCloning] = useState(false); const [error, setError] = useState(null); @@ -226,7 +228,7 @@ export function CloneTradingAnalyzer({ )}