import { cn } from "~/lib/utils"; import { Shield, TrendingUp, TrendingDown, Users, AlertTriangle, CheckCircle, Star, Bell } from "lucide-react"; import { Button } from "@/routes/ui/button"; import { ChainIcon } from "../components/shared/ChainIcon"; export interface TokenAnalysisData { /** Token symbol */ symbol: string; /** Token name */ name?: string; /** Blockchain */ chain: string; /** Current price */ price: string; /** 24h price change */ priceChange24h: number; /** Market cap */ marketCap?: string; /** 24h volume */ volume24h?: string; /** Liquidity */ liquidity?: string; /** Safety score (0-100) */ safetyScore?: number; /** Holder count */ holderCount?: number; /** Top 10 holder percentage */ top10HolderPercent?: number; } export interface TokenAnalysisWidgetProps { /** Token analysis data */ data: TokenAnalysisData; /** Whether token is in watchlist */ isInWatchlist?: boolean; /** Callback when add to watchlist is clicked */ onAddToWatchlist?: () => void; /** Callback when set alert is clicked */ onSetAlert?: () => void; /** Callback when analyze further is clicked */ onAnalyzeFurther?: () => void; /** Additional class names */ className?: string; } /** * TokenAnalysisWidget - Full token analysis card embedded in chat * * Displays comprehensive token analysis including price, safety score, * and key metrics. Used when AI responds to token research queries. */ export function TokenAnalysisWidget({ data, isInWatchlist = false, onAddToWatchlist, onSetAlert, onAnalyzeFurther, className, }: TokenAnalysisWidgetProps) { const getSafetyColor = (score?: number) => { if (!score) return "text-muted-foreground"; if (score >= 80) return "text-green-500"; if (score >= 60) return "text-yellow-500"; return "text-red-500"; }; const getSafetyLabel = (score?: number) => { if (!score) return "Unknown"; if (score >= 80) return "Low Risk"; if (score >= 60) return "Medium Risk"; return "High Risk"; }; return (
Market Cap
{data.marketCap}
24h Volume
{data.volume24h}
Liquidity
{data.liquidity}
Safety Score