import { Card, CardHeader } from '@/components/ui/Card' import { Badge } from '@/components/ui/Badge' import { Button } from '@/components/ui/Button' import { Zap, Plus, Play, Pause, CheckCircle2, GitBranch, Mail, MessageSquare, FileText, UserPlus, } from 'lucide-react' import { AgentFAB } from '@/components/agent/AgentFAB' const workflows = [ { id: '1', name: 'New Lead Notification', description: 'Send Slack notification when a new lead is created', status: 'active' as const, trigger: 'Lead Created', actions: ['Send Email', 'Slack Message'], lastRun: '2 min ago', runs: 1240, }, { id: '2', name: 'Invoice Reminder', description: 'Send reminder 3 days before invoice due date', status: 'active' as const, trigger: 'Schedule', actions: ['Send Email'], lastRun: '1 hour ago', runs: 856, }, { id: '3', name: 'Customer Onboarding', description: 'Welcome email series for new customers', status: 'active' as const, trigger: 'Customer Created', actions: ['Send Email', 'Create Task', 'Add to CRM'], lastRun: '15 min ago', runs: 342, }, { id: '4', name: 'Deal Stage Alert', description: 'Notify sales team when deal reaches negotiation', status: 'paused' as const, trigger: 'Deal Updated', actions: ['Send Email', 'Slack Message'], lastRun: '3 days ago', runs: 89, }, { id: '5', name: 'Employee Offboarding', description: 'Automated offboarding checklist', status: 'active' as const, trigger: 'Employee Terminated', actions: ['Create Task', 'Send Email', 'Update HR'], lastRun: '1 week ago', runs: 12, }, ] const actionIcons: Record = { 'Send Email': , 'Slack Message': , 'Create Task': , 'Add to CRM': , 'Update HR': , } export function AutomationPage() { const activeWorkflows = workflows.filter((w) => w.status === 'active').length const totalRuns = workflows.reduce((sum, w) => sum + w.runs, 0) return (
{/* Page Header */}

Automation

Workflows and automated tasks

{/* Quick Stats */}

{workflows.length}

Workflows

{activeWorkflows}

Active

{workflows.length - activeWorkflows}

Paused

{totalRuns.toLocaleString()}

Total Runs

{/* Workflows */}
{workflows.map((workflow) => (
{workflow.status === 'active' ? : }
{workflow.name} {workflow.status}

{workflow.description}

{workflow.trigger}
{workflow.actions.map((action, i) => ( {actionIcons[action]} {action} ))}

{workflow.runs.toLocaleString()}

runs

{workflow.lastRun}

last run

))}
{/* Automation Agent */}
) }