fix: implement trade button integration with AI analysis

- Add trade button next to each analysis result
- Fix TradeModal to properly receive and display analysis data
- Update TypeScript interfaces to match actual data structure
- Pre-fill Entry Price, Stop Loss, and Take Profit values from AI analysis
- Fix duplicate variable declarations causing build errors
- Remove TradeExecutionPanel from analysis page (reverted to original design)

 Trade button now opens modal with correct pre-filled values
 Analysis data properly passed between components
 Build errors resolved
This commit is contained in:
mindesbunister
2025-07-16 15:22:19 +02:00
parent ac50d9622c
commit 497e9ed0be
3 changed files with 802 additions and 21 deletions

View File

@@ -1,28 +1,21 @@
'use client'
import React, { useState } from 'react'
import AIAnalysisPanel from '../../components/AIAnalysisPanel.tsx'
import AIAnalysisPanel from '../../components/AIAnalysisPanel'
export default function AnalysisPage() {
const [analysisResult, setAnalysisResult] = useState(null)
const [currentSymbol, setCurrentSymbol] = useState('SOL')
const handleAnalysisComplete = (analysis, symbol) => {
setAnalysisResult(analysis)
setCurrentSymbol(symbol || 'SOL')
}
return (
<div className="space-y-8">
<div className="flex items-center justify-between">
<div>
<h1 className="text-3xl font-bold text-white">AI Analysis</h1>
<p className="text-gray-400 mt-2">Get comprehensive market insights powered by AI analysis</p>
</div>
<div className="text-center mb-8">
<h1 className="text-3xl font-bold text-white mb-4">
🤖 AI-Powered Market Analysis
</h1>
<p className="text-gray-400 max-w-2xl mx-auto">
Get professional trading insights with multi-timeframe analysis, precise entry/exit levels,
and institutional-quality recommendations powered by OpenAI.
</p>
</div>
<div className="max-w-6xl mx-auto">
<AIAnalysisPanel onAnalysisComplete={handleAnalysisComplete} />
</div>
<AIAnalysisPanel />
</div>
)
}