import { cn } from "~/lib/utils"; import { ArrowRight, Sparkles, TrendingUp, Shield, Wallet } from "lucide-react"; export type SuggestionType = "general" | "safety" | "trending" | "wallet" | "custom"; export interface SuggestionCardProps { /** Suggestion text to display */ text: string; /** Type of suggestion for icon selection */ type?: SuggestionType; /** Custom icon (overrides type icon) */ icon?: React.ReactNode; /** Click handler */ onClick?: (text: string) => void; /** Disabled state */ disabled?: boolean; /** Additional class names */ className?: string; } // Suggestion type icons const TYPE_ICONS: Record = { general: Sparkles, safety: Shield, trending: TrendingUp, wallet: Wallet, custom: Sparkles, }; /** * SuggestionCard - Clickable suggestion card for chat prompts * * Features: * - Type-specific icons * - Hover animations * - Click to send suggestion * - Accessible keyboard navigation */ export function SuggestionCard({ text, type = "general", icon, onClick, disabled = false, className, }: SuggestionCardProps) { const Icon = TYPE_ICONS[type]; const handleClick = () => { if (!disabled && onClick) { onClick(text); } }; const handleKeyDown = (e: React.KeyboardEvent) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); handleClick(); } }; return (
{/* Icon */}
{icon || }
{/* Text */} {text} {/* Arrow indicator */}
); } /** * Default crypto-related suggestions */ export const DEFAULT_CRYPTO_SUGGESTIONS: Array<{ text: string; type: SuggestionType }> = [ { text: "Is this token safe to invest in?", type: "safety" }, { text: "What are the top gainers on Solana today?", type: "trending" }, { text: "Analyze this wallet's trading history", type: "wallet" }, { text: "Check for rug pull indicators", type: "safety" }, { text: "What's the market sentiment for this token?", type: "general" }, ];