"use client"; import { useMemo } from "react"; import { Upload, Cpu, MessageSquare, Shield, FileText, Check, Sparkles, Zap, Link, Target, } from "lucide-react"; import { useScrollAnimation } from "@/hooks/useScrollAnimation"; // Step Card Component interface StepCardProps { number: string; title: string; description: string; icon: React.ElementType; gradient: string; delay: number; isLast?: boolean; } function StepCard({ number, title, description, icon: Icon, gradient, delay, isLast = false, }: StepCardProps) { const { ref, isVisible } = useScrollAnimation({ threshold: 0.3, }); return (
{/* Connector Line - Desktop */} {!isLast && ( <> {/* Horizontal connector for desktop */}
{/* Animated dots */}
{/* Vertical connector for mobile */}
)} {/* Card */}
{/* Icon with Number */}
{/* Number Badge */}
{number}
{/* Glow Effect */}
{/* Content */}

{title}

{description}

); } // Upload Animation function UploadAnimation() { const { ref, isVisible } = useScrollAnimation({ threshold: 0.3, }); return (
{/* Drop Zone */}

Drop files here or click to browse

{/* File List */}
{[ { name: "contract_v2.pdf", size: "2.4 MB", progress: 100 }, { name: "agreement_scan.jpg", size: "1.8 MB", progress: 75 }, ].map((file, i) => (

{file.name}

{file.size} {file.progress === 100 && ( )}
))}
{/* Format Badges */}
{["PDF", "JPG", "PNG"].map((format, i) => ( {format} ))}
); } // AI Analysis Animation function AIAnalysisAnimation() { const { ref, isVisible } = useScrollAnimation({ threshold: 0.3, }); const scanHeights = useMemo( () => [ 22, 38, 55, 40, 62, 30, 70, 45, 58, 35, 66, 28, 52, 48, 60, 33, 57, 41, 64, 36, ], [], ); const analysisPoints = [ { label: "Clauses detected", value: "47", icon: Target }, { label: "Risk assessment", value: "Low", icon: Shield, color: "text-emerald-500", }, { label: "Processing time", value: "2.3s", icon: Zap, color: "text-amber-500", }, ]; return (
{/* AI Brain */}
{/* Analysis Progress */}
{analysisPoints.map((point, i) => (
{point.label}
{point.value}
))}
{/* Scanning Effect */}
{scanHeights.map((height, i) => (
))}
); } // Chat Animation function ChatStepAnimation() { const { ref, isVisible } = useScrollAnimation({ threshold: 0.3, }); const messages = [ { text: "Explain the termination clause", isUser: true }, { text: "Section 12.3: Either party may terminate with 30 days written notice...", isUser: false, }, ]; return (
{messages.map((msg, i) => (
{!msg.isUser && (
)}
{msg.text}
))}
{/* RAG Indicator */}
Powered by RAG
); } // Blockchain Animation function BlockchainStepAnimation() { const { ref, isVisible } = useScrollAnimation({ threshold: 0.3, }); return (
{/* Blockchain Visual */}
{[0, 1, 2].map((i) => (
{i < 2 && (
)}
))}
{/* Certificate */}

Verified on Polygon

0x3f7a...9e2d

{/* Timestamp */}
Timestamped: {new Date().toLocaleString()}
); } export function HowItWorks() { const { ref: headerRef, isVisible: headerVisible } = useScrollAnimation(); const steps = [ { number: "01", title: "Upload Your Contract", description: "PDF, images, or scanned documents. Simply drag and drop or click to browse.", icon: Upload, gradient: "bg-gradient-to-br from-blue-500 to-blue-600", animation: , }, { number: "02", title: "AI Extracts & Analyzes", description: "GPT-4 Turbo understands your contract deeply. Automatic extraction of all important clauses and terms.", icon: Cpu, gradient: "bg-gradient-to-br from-violet-500 to-purple-600", animation: , }, { number: "03", title: "Chat with AI Assistant", description: "Get instant answers to any questions. Powered by RAG for precise, context-aware responses.", icon: MessageSquare, gradient: "bg-gradient-to-br from-teal-500 to-cyan-600", animation: , }, { number: "04", title: "Immutable Certification", description: "Registered on Polygon blockchain. Legally valid timestamped proof of submission.", icon: Shield, gradient: "bg-gradient-to-br from-emerald-500 to-green-600", animation: , }, ]; return (
{/* Background */}
{/* Section Header */}
Simple Process

From Upload to Certification in{" "} 4 Steps

Our intelligent system handles everything automatically

{/* Steps Grid */}
{steps.map((step, index) => (
{step.animation}
))}
{/* Custom Animation Keyframes */}
); }