"use client"; import React, { useRef, useEffect } from 'react'; import { gsap } from 'gsap'; import { ScrollTrigger } from 'gsap/ScrollTrigger'; import { Button } from '@/components/ui/button'; import { Card, CardHeader, CardTitle, CardDescription, CardContent } from '@/components/ui/card'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Progress } from '@/components/ui/progress'; import { Rocket, BrainCircuit, UserCog, Database, Shield } from 'lucide-react'; // Register GSAP plugins gsap.registerPlugin(ScrollTrigger); interface OnboardingStep { id: string; title: string; description: string; icon: React.ReactNode; component: React.ReactNode; } export default function DigitalTwinOnboarding() { const containerRef = useRef(null); const progressRef = useRef(null); const [currentStep, setCurrentStep] = React.useState(0); const [completedSteps, setCompletedSteps] = React.useState>(new Set()); // Animation setup useEffect(() => { const ctx = gsap.context(() => { gsap.from(".onboarding-card", { opacity: 0, y: 50, duration: 0.8, stagger: 0.15, ease: "power3.out", }); ScrollTrigger.create({ trigger: containerRef.current, start: "top top", end: "bottom bottom", onUpdate: (self) => { if (progressRef.current) { progressRef.current.style.width = `${self.progress * 100}%`; } }, }); }, containerRef); return () => ctx.revert(); }, []); const onboardingSteps: OnboardingStep[] = [ { id: "personalization", title: "Personalization Setup", description: "Configure your digital twin's personality and interaction style", icon: , component: (
{['Technology', 'Business', 'Creative Arts', 'Science', 'Health'].map((domain) => ( ))}
), }, { id: "data-sources", title: "Data Integration", description: "Connect your digital twin to your knowledge sources", icon: , component: (

Connect your email for communication context

Enable scheduling and time management

Access your documents and files

), }, { id: "capabilities", title: "Capabilities Selection", description: "Select your digital twin's core competencies", icon: , component: (
{[ "Email Management", "Schedule Optimization", "Research Assistant", "Meeting Summaries", "Data Analysis", "Content Generation", "Task Automation", "Learning Companion", ].map((capability) => ( ))}
), }, { id: "security", title: "Privacy & Security", description: "Configure your data protection preferences", icon: , component: (

Allow temporary data storage for context continuity

Help improve the system while protecting your identity

Maximum security for all your communications

), }, ]; const handleNext = () => { setCompletedSteps(new Set(completedSteps).add(onboardingSteps[currentStep].id)); if (currentStep < onboardingSteps.length - 1) { setCurrentStep(currentStep + 1); } }; const handleBack = () => { if (currentStep > 0) { setCurrentStep(currentStep - 1); } }; return (

Configure Your Digital Twin

Personalize your AI companion in just a few steps

{onboardingSteps.map((step, index) => (
= index ? 'bg-indigo-600 text-white' : 'bg-slate-200 text-slate-600' } ${ completedSteps.has(step.id) ? 'ring-2 ring-offset-2 ring-indigo-500' : '' }`} > {index + 1}
{step.title}
))}
{onboardingSteps[currentStep].icon}
{onboardingSteps[currentStep].title} {onboardingSteps[currentStep].description}
{onboardingSteps[currentStep].component}
); }