'use client'; /** * TipBox Component - Dual Style System * * Provides two distinct styles for callouts/notes: * * 1. Compact Style (Variant A inspired): * - Small emoji icon on left * - Compact padding (p-4) * - Smaller text (text-sm) * - Subtle background with thin border * - Best for minor notes and tips * * 2. Prominent Style (Adapted from Variant C): * - NO icon * - Larger padding (p-6) * - Larger text (text-base) * - Gradient border with soft glow * - More visual weight * - Best for important warnings and security notices * * Usage: * * This is a compact tip * * * * This is an important security warning * */ import { ReactNode } from 'react'; type TipType = 'info' | 'warning' | 'success'; type TipVariant = 'compact' | 'prominent'; interface TipBoxProps { children: ReactNode; variant?: TipVariant; type?: TipType; } const icons: Record = { info: '💡', warning: '⚠️', success: '✓', }; const compactStyles: Record = { info: 'bg-purple-500/10 border-purple-500/20 text-purple-300', warning: 'bg-amber-500/10 border-amber-500/20 text-amber-300', success: 'bg-green-500/10 border-green-500/20 text-green-300', }; const prominentStyles: Record = { info: 'bg-gradient-to-br from-purple-500/5 via-cyan-500/5 to-purple-500/5 border-purple-500/30 text-gray-300 shadow-lg shadow-purple-500/10', warning: 'bg-gradient-to-br from-amber-500/5 via-orange-500/5 to-amber-500/5 border-amber-500/30 text-gray-300 shadow-lg shadow-amber-500/10', success: 'bg-gradient-to-br from-green-500/5 via-emerald-500/5 to-green-500/5 border-green-500/30 text-gray-300 shadow-lg shadow-green-500/10', }; export const TipBox = ({ children, variant = 'compact', type = 'info' }: TipBoxProps) => { const isCompact = variant === 'compact'; const icon = icons[type]; const styleClass = isCompact ? compactStyles[type] : prominentStyles[type]; if (isCompact) { return (
{icon}
{children}
); } // Prominent style return (
{children}
); };