/** * ╔═══════════════════════════════════════════════════════════════════════════╗ * ║ IDEA STICKY NOTE ║ * ║═══════════════════════════════════════════════════════════════════════════║ * ║ Playful sticky note visualization for incubated ideas ║ * ║ Part of the Liquid UI Arsenal ║ * ╚═══════════════════════════════════════════════════════════════════════════╝ */ import { useState } from 'react'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { cn } from '@/lib/utils'; import { Lightbulb, Sparkles, ArrowUpRight, X, ThumbsUp, Brain, Tag, Clock, User } from 'lucide-react'; export interface Idea { id: string; title: string; hypothesis: string; confidence: number; status: 'INCUBATED' | 'PROMOTED' | 'REJECTED' | 'IMPLEMENTED'; proposedBy: string; tags?: string[]; relatedTo?: string; created_at: string; votes?: number; } export interface IdeaStickyNoteProps { idea: Idea; onPromote?: (ideaId: string) => void; onReject?: (ideaId: string) => void; onVote?: (ideaId: string) => void; color?: 'yellow' | 'pink' | 'blue' | 'green' | 'purple'; tilt?: number; } const colorStyles = { yellow: { bg: 'bg-gradient-to-br from-yellow-200 to-yellow-300', border: 'border-yellow-400/50', text: 'text-yellow-900', accent: 'text-yellow-700', shadow: 'shadow-yellow-500/20', }, pink: { bg: 'bg-gradient-to-br from-pink-200 to-pink-300', border: 'border-pink-400/50', text: 'text-pink-900', accent: 'text-pink-700', shadow: 'shadow-pink-500/20', }, blue: { bg: 'bg-gradient-to-br from-blue-200 to-blue-300', border: 'border-blue-400/50', text: 'text-blue-900', accent: 'text-blue-700', shadow: 'shadow-blue-500/20', }, green: { bg: 'bg-gradient-to-br from-green-200 to-green-300', border: 'border-green-400/50', text: 'text-green-900', accent: 'text-green-700', shadow: 'shadow-green-500/20', }, purple: { bg: 'bg-gradient-to-br from-purple-200 to-purple-300', border: 'border-purple-400/50', text: 'text-purple-900', accent: 'text-purple-700', shadow: 'shadow-purple-500/20', }, }; const statusBadges = { INCUBATED: { icon: Brain, label: 'Incubating', class: 'bg-yellow-500/80 text-yellow-900' }, PROMOTED: { icon: ArrowUpRight, label: 'Promoted!', class: 'bg-green-500/80 text-green-900' }, REJECTED: { icon: X, label: 'Rejected', class: 'bg-red-500/80 text-red-900' }, IMPLEMENTED: { icon: Sparkles, label: 'Implemented', class: 'bg-blue-500/80 text-blue-900' }, }; export function IdeaStickyNote({ idea, onPromote, onReject, onVote, color = 'yellow', tilt = 0, }: IdeaStickyNoteProps) { const [isHovered, setIsHovered] = useState(false); const styles = colorStyles[color]; const status = statusBadges[idea.status]; const StatusIcon = status.icon; // Random tilt for playful look const rotation = tilt || (Math.random() * 6 - 3); // Confidence as visual indicator const confidenceStars = Math.round(idea.confidence * 5); const timeSince = (dateStr: string) => { const date = new Date(dateStr); const now = new Date(); const diffMs = now.getTime() - date.getTime(); const diffHours = Math.floor(diffMs / 3600000); const diffDays = Math.floor(diffHours / 24); if (diffDays > 0) return `${diffDays}d`; if (diffHours > 0) return `${diffHours}h`; return 'now'; }; return (
"{idea.hypothesis}"
{/* Confidence stars */}