feat(chat): integrate Epic 2, 3, 4 widgets into chat interface

- Create 5 widget wrappers for inline chat display:
  * WhaleActivityWidget - Wraps WhaleActivityFeed for whale transaction display
  * TradingSuggestionWidget - Wraps TradingSuggestionPanel for entry/exit suggestions
  * PortfolioWidget - Wraps PortfolioPanel for portfolio tracking
  * ChartCaptureWidget - Wraps ChartCapturePanel for chart screenshots
  * ThreadGeneratorWidget - Wraps ThreadGeneratorPanel for Twitter threads

- Update widgets/index.ts to export new widgets with Epic grouping

- Update ChatMessages.tsx:
  * Add 5 new widget types to MessageWidget union
  * Import new widget components and their types
  * Add renderWidget cases for all new widgets with proper callbacks
  * Update component documentation to list all supported widgets

- Widget integration pattern:
  * Widgets wrap panels in containers with consistent styling
  * All widgets support callback props for user interactions
  * Widgets can be embedded inline in assistant messages
  * Widget actions are handled via onWidgetAction callback

Enables AI to display Epic 2, 3, 4 panels inline in chat conversations
This commit is contained in:
API Test Bot 2026-02-04 02:55:50 +07:00
parent 9f75abf0a5
commit 0d2cac99d5
7 changed files with 252 additions and 1 deletions

View file

@ -0,0 +1,43 @@
import { PortfolioPanel, type PortfolioData, type PortfolioHolding } from "../portfolio/PortfolioPanel";
export interface PortfolioWidgetProps {
/** Portfolio data */
portfolio: PortfolioData;
/** Callback when refresh is clicked */
onRefresh?: () => void;
/** Callback when "Analyze" is clicked for a token */
onAnalyzeToken?: (holding: PortfolioHolding) => void;
/** Callback when "Set Alert" is clicked for a token */
onSetAlert?: (holding: PortfolioHolding) => void;
/** Callback when "View on DexScreener" is clicked */
onViewToken?: (holding: PortfolioHolding) => void;
/** Callback when "Add Manual Position" is clicked */
onAddPosition?: () => void;
}
/**
* PortfolioWidget - Inline portfolio display in chat
* Wraps PortfolioPanel for conversational UX
*/
export function PortfolioWidget({
portfolio,
onRefresh,
onAnalyzeToken,
onSetAlert,
onViewToken,
onAddPosition,
}: PortfolioWidgetProps) {
return (
<div className="my-3 max-h-[600px] overflow-hidden rounded-lg border">
<PortfolioPanel
portfolio={portfolio}
onRefresh={onRefresh}
onAnalyzeToken={onAnalyzeToken}
onSetAlert={onSetAlert}
onViewToken={onViewToken}
onAddPosition={onAddPosition}
/>
</div>
);
}