mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-28 10:26:33 +02:00
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:
parent
9f75abf0a5
commit
0d2cac99d5
7 changed files with 252 additions and 1 deletions
|
|
@ -0,0 +1,40 @@
|
|||
import { ThreadGeneratorPanel, type GeneratedThread } from "../content/ThreadGeneratorPanel";
|
||||
|
||||
export interface ThreadGeneratorWidgetProps {
|
||||
/** Current token info */
|
||||
tokenAddress?: string;
|
||||
tokenSymbol?: string;
|
||||
chain?: string;
|
||||
/** Generated thread (if available) */
|
||||
generatedThread?: GeneratedThread;
|
||||
/** Callback when thread is generated */
|
||||
onGenerate?: (request: any) => void;
|
||||
/** Callback when thread is exported */
|
||||
onExport?: (format: "copy" | "twitter") => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* ThreadGeneratorWidget - Inline thread generator in chat
|
||||
* Wraps ThreadGeneratorPanel for conversational UX
|
||||
*/
|
||||
export function ThreadGeneratorWidget({
|
||||
tokenAddress,
|
||||
tokenSymbol,
|
||||
chain,
|
||||
generatedThread,
|
||||
onGenerate,
|
||||
onExport,
|
||||
}: ThreadGeneratorWidgetProps) {
|
||||
return (
|
||||
<div className="my-3 max-h-[600px] overflow-hidden rounded-lg border">
|
||||
<ThreadGeneratorPanel
|
||||
tokenAddress={tokenAddress}
|
||||
tokenSymbol={tokenSymbol}
|
||||
chain={chain}
|
||||
onGenerate={onGenerate}
|
||||
onExport={onExport}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue