"use client"; import type { LucideIcon } from "lucide-react"; import { ChevronLeftIcon, Chrome, LayoutGrid, Leaf, Lock, Puzzle, Shield, Sparkles, Star, User, Workflow, } from "lucide-react"; import { AnimatePresence, motion } from "motion/react"; import { useState } from "react"; import { Button } from "@/components/ui/button"; import { Checkbox } from "@/components/ui/checkbox"; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { cn } from "@/lib/utils"; interface IconListItem { icon: LucideIcon; title: string; } interface StepDef { title: string; description: string | IconListItem[]; className?: string; isBlocking?: boolean; component: React.ComponentType; secondaryCta?: React.ComponentType; cta?: React.ComponentType; } const Background = () => { return (
logo
    {Array.from({ length: 5 }).map((_, index) => { return (
  • ); })}
); }; interface StepIndicatorProps { totalSteps: number; currentStep: number; } const StepIndicator = ({ totalSteps, currentStep }: StepIndicatorProps) => { return (
{Array.from({ length: totalSteps }).map((_, i) => { return ( = i ? "bg-primary" : "border bg-muted", )} /> ); })}
); }; interface FadeContainerProps { children: React.ReactNode; condition: boolean; className?: string; } const FadeContainer = ({ children, condition, className, }: FadeContainerProps) => { const fadeVariants = { initial: { opacity: 0, filter: "blur(4px)", }, animate: { opacity: 1, filter: "blur(0px)", }, exit: { opacity: 0, filter: "blur(4px)", }, }; return ( {condition && ( {children} )} ); }; interface StepDescriptionCardProps { title: string; description: string | IconListItem[]; } const StepDescriptionCard = ({ title, description, }: StepDescriptionCardProps) => { return (

{title}

{typeof description === "string" ? (

{description}

) : (
    {description?.map((item, i) => { return (
  • {item.title}

  • ); })}
)}
); }; interface StepComponentProps { stepIndex: number; onValidationChange: (stepIndex: number, isValid: boolean) => void; } interface StepCtaProps { onClick: () => void; disabled?: boolean; } const StepOneComponent = () => { return (
e.preventDefault()} className="grid grid-cols-2 gap-2 md:gap-4" >
); }; const StepTwoComponent = () => { const goalOptions = [ { value: "close-deals", label: "بستن معاملات بیشتر" }, { value: "grow-network", label: "شبکه ام را رشد بده" }, { value: "track-pipeline", label: "خط لوله من را دنبال کنید" }, { value: "automate-outreach", label: "دسترسی خودکار" }, { value: "team-collaboration", label: "همکاری با تیم" }, { value: "find-prospects", label: "چشم انداز جدید پیدا کنید" }, { value: "retain-customers", label: "حفظ مشتریان" }, { value: "analyze-performance", label: "تجزیه و تحلیل عملکرد" }, { value: "streamline-workflow", label: "گردش کار را ساده کنید" }, { value: "other", label: "یک چیز دیگر" }, ]; const [selectedGoals, setSelectedGoals] = useState([]); const toggleGoal = (goalValue: string, checked: boolean) => { setSelectedGoals((prev) => checked ? [...prev, goalValue] : prev.filter((value) => value !== goalValue), ); }; return (
e.preventDefault()} className="grid grid-cols-2 gap-6 pb-2 lg:gap-8" > {goalOptions.map((goal) => { const isSelected = selectedGoals.includes(goal.value); return ( ); })}
); }; const StepThreeComponent = ({ stepIndex, onValidationChange, }: StepComponentProps) => { const [isConnected, setIsConnected] = useState(false); const handleConnectButtonClick = (provider: string) => { setIsConnected(provider); onValidationChange(stepIndex, true); }; return (
); }; const StepFourComponent = () => { return (
Dashboard placeholder

50k+ active users

امتیاز ۴٫۹ از ۵

{Array.from({ length: 5 }).map((_, i) => { return ; })}
); }; const StepFourSecondaryCta = () => { return ( ); }; const StepFourCta = ({ onClick, disabled }: StepCtaProps) => { return ( ); }; const StepFiveComponent = () => { const premiumFeatures = [ { icon: LayoutGrid, title: "Custom Views", description: "Organize your data exactly how you want it", }, { icon: Workflow, title: "Automation", description: "Set up triggers and actions to save time", }, { icon: Chrome, title: "Web Clipper", description: "Save contacts from any website instantly", }, { icon: Sparkles, title: "AI Insights", description: "Get smart suggestions and auto-complete data", }, { icon: Puzzle, title: "App Connections", description: "Sync with 2000+ tools you already use", }, { icon: Star, title: "پشتیبانی اولویت‌دار", description: "Dedicated help and راه‌اندازی اولیه assistance", }, ]; return (
    {premiumFeatures.map((feature) => (
  • {feature.title}

    {feature.description}

  • ))}
); }; const StepFiveCta = ({ onClick, disabled }: StepCtaProps) => { return ( ); }; interface Onboarding2Props { steps: StepDef[]; className?: string; } const Onboarding2 = ({ steps = [ { title: " درمورد خودتون به ما بگویید", description: "چند سوال سریع در مورد تجربه ی شخصیتون", className: "bg-orange-200", component: StepOneComponent, }, { title: "چی میخوای به دست بیاری؟", description: "انتخاب همه که اعمال می‌شوند. این به ما کمک می‌کند داشبورد و پیشنهادهای شما را متناسب‌ سازی کنیم", className: "bg-blue-200", component: StepTwoComponent, }, { title: "لینک اکانت شما", description: [ { icon: User, title: "مخاطبین و جلسات و گفتگوهای خود رو به‌ صورت خودکار همگام‌سازی کنید", }, { icon: Shield, title: "دیتا شما ایمن و خصوصی میماند", }, { icon: Lock, title: "رمزنگاری با استاندارد سازمانی", }, ], className: "bg-pink-200", isBlocking: true, component: StepThreeComponent, }, { title: "به وب‌گردی خود سرعت و قدرت ببخشید", description: "افزونه ما به شما این امکان را می‌دهد که با یک کلیک، از هر وب‌سایتی که هستید مخاطبین را ذخیره کنید و یادداشت بردارید", className: "bg-green-200", component: StepFourComponent, secondaryCta: StepFourSecondaryCta, cta: StepFourCta, }, { title: "تجربه کامل رو باز کنید ( دسترسی به تمام امکانات )", description: "دوره آزمایشی ۱۴ روزه خود را آغاز کرده و تمامی ویژگی‌ها را تجربه کنید نیاز به کارت اعتباری نیست.", className: "bg-purple-200", component: StepFiveComponent, cta: StepFiveCta, }, ], className, }: Onboarding2Props) => { const [currentStep, setCurrentStep] = useState(0); const [stepValidation, setStepValidation] = useState>( {}, ); const handleStepValidChange = (stepIndex: number, isValid: boolean) => { setStepValidation((prev) => ({ ...prev, [stepIndex]: isValid })); }; const canProceed = () => { const step = steps[currentStep]; if (!step.component || !step.isBlocking) return true; return stepValidation[currentStep] === true; }; const handleNext = () => { if (currentStep < steps.length - 1) { setCurrentStep(currentStep + 1); } }; const handlePrevious = () => { if (currentStep > 0) { setCurrentStep(currentStep - 1); } }; const step = steps[currentStep]; return (
راه‌اندازی اولیه راهنمای شروع کار
0}>
{step.cta ? ( ) : ( )} {step.secondaryCta && }
); }; export { Onboarding2 };