mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-28 18:36:23 +02:00
- 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
31 lines
910 B
TypeScript
31 lines
910 B
TypeScript
import { WhaleActivityFeed, type WhaleTransaction } from "../whale/WhaleActivityFeed";
|
|
|
|
export interface WhaleActivityWidgetProps {
|
|
/** List of whale transactions */
|
|
transactions: WhaleTransaction[];
|
|
/** Callback when a wallet is tracked */
|
|
onTrackWallet?: (address: string) => void;
|
|
/** Callback when a transaction is viewed */
|
|
onViewTransaction?: (txHash: string) => void;
|
|
}
|
|
|
|
/**
|
|
* WhaleActivityWidget - Inline whale activity display in chat
|
|
* Wraps WhaleActivityFeed for conversational UX
|
|
*/
|
|
export function WhaleActivityWidget({
|
|
transactions,
|
|
onTrackWallet,
|
|
onViewTransaction,
|
|
}: WhaleActivityWidgetProps) {
|
|
return (
|
|
<div className="my-3">
|
|
<WhaleActivityFeed
|
|
transactions={transactions}
|
|
onTrackWallet={onTrackWallet}
|
|
onViewTransaction={onViewTransaction}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
|