import { useState } from "react"; import { cn } from "~/lib/utils"; import { TrendingUp, TrendingDown, Target, AlertCircle, Info, DollarSign, Percent, Clock, } from "lucide-react"; import { Button } from "@/routes/ui/button"; import { ChainIcon } from "../components/shared/ChainIcon"; export interface TradingSuggestion { tokenAddress: string; tokenSymbol: string; tokenName: string; chain: string; currentPrice: number; timestamp: Date; entry: { min: number; max: number; reasoning: string; }; targets: { level: number; price: number; percentGain: number; confidence: number; }[]; stopLoss: { price: number; percentLoss: number; reasoning: string; }; riskReward: number; overallConfidence: number; technicalLevels: { support: number[]; resistance: number[]; }; reasoning: string[]; invalidationConditions: string[]; } export interface TradingSuggestionPanelProps { /** Trading suggestion data */ suggestion: TradingSuggestion; /** Callback when "Set Alerts" is clicked */ onSetAlerts?: () => void; /** Callback when "View Chart" is clicked */ onViewChart?: () => void; /** Additional class names */ className?: string; } /** * TradingSuggestionPanel - AI-powered entry/exit suggestions * * Features: * - Entry zone recommendations * - Multiple take-profit targets * - Stop-loss suggestions * - Risk/reward ratio calculation * - Technical analysis levels * - AI reasoning and invalidation conditions */ export function TradingSuggestionPanel({ suggestion, onSetAlerts, onViewChart, className, }: TradingSuggestionPanelProps) { const [showDetails, setShowDetails] = useState(false); const formatPrice = (price: number) => { if (price < 0.01) return `$${price.toFixed(8)}`; if (price < 1) return `$${price.toFixed(6)}`; return `$${price.toFixed(4)}`; }; const getRiskRewardColor = (ratio: number) => { if (ratio >= 3) return "text-green-600 dark:text-green-400"; if (ratio >= 2) return "text-yellow-600 dark:text-yellow-400"; return "text-red-600 dark:text-red-400"; }; const getRiskRewardLabel = (ratio: number) => { if (ratio >= 3) return "Excellent"; if (ratio >= 2) return "Good"; if (ratio >= 1.5) return "Fair"; return "Poor"; }; return (
{suggestion.tokenSymbol} •
{suggestion.entry.reasoning}
{suggestion.stopLoss.reasoning}