import { cn } from "~/lib/utils"; import { CheckCircle, Bell, Eye, Settings } from "lucide-react"; import { Button } from "@/routes/ui/button"; export interface ActionConfirmationProps { /** Type of action that was confirmed */ actionType: "watchlist_add" | "watchlist_remove" | "alert_set" | "alert_delete"; /** Token symbol */ tokenSymbol: string; /** Additional details about the action */ details?: string[]; /** Callback when view watchlist is clicked */ onViewWatchlist?: () => void; /** Callback when edit alerts is clicked */ onEditAlerts?: () => void; /** Additional class names */ className?: string; } /** * ActionConfirmationWidget - Embedded widget showing action confirmation in chat * * Used when AI executes an action like adding to watchlist or setting alerts. * Displays confirmation with relevant follow-up actions. */ export function ActionConfirmationWidget({ actionType, tokenSymbol, details = [], onViewWatchlist, onEditAlerts, className, }: ActionConfirmationProps) { const getActionTitle = () => { switch (actionType) { case "watchlist_add": return `${tokenSymbol} added to your watchlist`; case "watchlist_remove": return `${tokenSymbol} removed from watchlist`; case "alert_set": return `Alert configured for ${tokenSymbol}`; case "alert_delete": return `Alert removed for ${tokenSymbol}`; default: return "Action completed"; } }; const getIcon = () => { switch (actionType) { case "watchlist_add": case "watchlist_remove": return Eye; case "alert_set": case "alert_delete": return Bell; default: return CheckCircle; } }; const Icon = getIcon(); return (
Also set up:
{details.map((detail, index) => (