'use client'; import React from 'react'; import { motion } from 'framer-motion'; import FlowchartNode from './FlowchartNode'; import type { WorkflowTransformation } from '../../lib/types'; interface BeforeAfterWorkflowProps { data: WorkflowTransformation; } function detectNodeType(step: string) { const text = step.toLowerCase(); if ( text.includes('approve') || text.includes('approval') ) { return 'approval'; } if ( text.includes('decision') || text.includes('verify') || text.includes('check') ) { return 'decision'; } if ( text.includes('api') || text.includes('service') ) { return 'api'; } if ( text.includes('queue') || text.includes('kafka') || text.includes('async') ) { return 'queue'; } if ( text.includes('llm') || text.includes('ai') || text.includes('parser') ) { return 'llm'; } if ( text.includes('human') || text.includes('manual') || text.includes('review') ) { return 'human_review'; } if ( text.includes('email') || text.includes('notify') || text.includes('notification') ) { return 'notification'; } return 'task'; } function mapWorkflowTypeToFlowchartType(type: string) { switch (type) { case 'input': return 'input'; case 'task': return 'task'; case 'decision': return 'decision'; case 'automation': return 'automation'; case 'approval': return 'approval'; case 'output': return 'output'; case 'api': return 'api'; case 'queue': return 'queue'; case 'llm': return 'llm'; case 'human_review': return 'human_review'; case 'notification': return 'notification'; default: return 'task'; } } export default function BeforeAfterWorkflow({ data, }: BeforeAfterWorkflowProps) { if (!data) { return null; } return (
{/* Header */}
WORKFLOW REDESIGN ENGINE

Before → After Transformation

Visualize how fragmented manual operations transform into production-grade, AI-native operational systems.

{/* Main Layout */}
{/* BEFORE FLOW */}
BEFORE — MANUAL WORKFLOW
{data.before.map((step, index) => ( ))}
{/* CENTER TRANSFORMATION */}
{/* AFTER FLOW */}
AFTER — AI NATIVE SYSTEM
{data.after.map((step, index) => ( ))}
); }