import { cn } from "~/lib/utils"; import { TrendingUp, TrendingDown, Bell, Trash2, Search, Plus } from "lucide-react"; import { Button } from "@/routes/ui/button"; import { ChainIcon } from "../components/shared/ChainIcon"; export interface WatchlistItem { id: string; symbol: string; name?: string; chain: string; price: string; priceChange24h: number; alertCount?: number; } export interface WatchlistWidgetProps { /** List of tokens in watchlist */ tokens: WatchlistItem[]; /** Callback when analyze token is clicked */ onAnalyze?: (token: WatchlistItem) => void; /** Callback when remove token is clicked */ onRemove?: (tokenId: string) => void; /** Callback when add token is clicked */ onAddToken?: () => void; /** Callback when clear all is clicked */ onClearAll?: () => void; /** Additional class names */ className?: string; } /** * WatchlistWidget - Embedded watchlist widget for chat interface * * Displays user's watchlist inline in the chat conversation. * Supports quick actions like analyze, remove, and add tokens. */ export function WatchlistWidget({ tokens, onAnalyze, onRemove, onAddToken, onClearAll, className, }: WatchlistWidgetProps) { if (tokens.length === 0) { return (
📋 Your Watchlist
Your watchlist is empty. Add tokens to track them!
); } return (
{/* Header */}
📋 WatchlistWidget
{tokens.length} tokens
{/* Token list */}
{tokens.map((token) => (
{/* Token info */}
{token.symbol} {token.alertCount && token.alertCount > 0 && ( {token.alertCount} )}

{token.price}

{/* Price change */}
= 0 ? "text-green-500" : "text-red-500" )}> {token.priceChange24h >= 0 ? ( ) : ( )} {token.priceChange24h >= 0 ? "+" : ""}{token.priceChange24h.toFixed(1)}%
{/* Actions */}
))}
{/* Footer actions */}
{tokens.length > 0 && ( )}
); }