import React from 'react'; import { motion } from 'framer-motion'; import { useTranslation } from 'react-i18next'; import { Calendar, Mail, MessageSquare, Clock, Search, FileText, Sparkles, ChevronRight, } from 'lucide-react'; import type { LucideIcon } from 'lucide-react'; interface WorkflowBlock { icon: LucideIcon; label: string; type: 'trigger' | 'action'; } interface WorkflowVisualProps { trigger: string; actions: string[]; variant?: 'winback' | 'noshow' | 'report'; } const getWorkflowConfig = ( variant: WorkflowVisualProps['variant'] ): WorkflowBlock[] => { switch (variant) { case 'winback': return [ { icon: Clock, label: 'Schedule: Weekly', type: 'trigger' }, { icon: Search, label: 'Find Inactive Customers', type: 'action' }, { icon: Mail, label: 'Send Email', type: 'action' }, ]; case 'noshow': return [ { icon: Calendar, label: 'Event Created', type: 'trigger' }, { icon: Clock, label: 'Wait 2 Hours Before', type: 'action' }, { icon: MessageSquare, label: 'Send SMS', type: 'action' }, ]; case 'report': return [ { icon: Clock, label: 'Daily at 6 PM', type: 'trigger' }, { icon: FileText, label: "Get Tomorrow's Schedule", type: 'action' }, { icon: Mail, label: 'Send Summary', type: 'action' }, ]; default: return [ { icon: Calendar, label: 'Event Created', type: 'trigger' }, { icon: Clock, label: 'Wait', type: 'action' }, { icon: Mail, label: 'Send Notification', type: 'action' }, ]; } }; const WorkflowVisual: React.FC = ({ variant = 'noshow', }) => { const { t } = useTranslation(); const blocks = getWorkflowConfig(variant); return (
{/* AI Copilot Input */}
{t('marketing.plugins.aiCopilot.placeholder')}

{t('marketing.plugins.aiCopilot.examples')}

{/* Workflow Visualization */}
{blocks.map((block, index) => ( {/* Block */}
{block.type === 'trigger' ? 'When' : 'Then'}

{block.label}

{/* Connector */} {index < blocks.length - 1 && (
)}
))}
{/* Integration badges */}

{t('marketing.plugins.integrations.description')}

{['Gmail', 'Slack', 'Sheets', 'Twilio'].map((app) => ( {app} ))} +1000 more
); }; export default WorkflowVisual;