aboutsummaryrefslogtreecommitdiff
path: root/apps/web/app/onboarding/onboarding-form.tsx
blob: b943e5f4ec19ea80ac5b34c331573141f0d029c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
"use client"

import { motion, AnimatePresence } from "motion/react"
import { NameForm } from "./name-form"
import { Intro } from "./intro"
import { useOnboarding } from "./onboarding-context"
import { BioForm } from "./bio-form"
import { ExtensionForm } from "./extension-form"
import { MCPForm } from "./mcp-form"
import { Welcome } from "./welcome"
import { Space_Grotesk } from "next/font/google"
import { cn } from "@lib/utils"

const sans = Space_Grotesk({
	subsets: ["latin"],
	variable: "--font-sans",
})

export function OnboardingForm() {
	const { currentStep, resetIntroTriggers } = useOnboarding()

	return (
		<div
			className={cn(
				"text-2xl md:text-4xl px-4 md:px-6 py-6 md:py-8 flex flex-col justify-center w-full max-w-4xl mx-auto",
				sans.variable,
			)}
		>
			<AnimatePresence mode="wait" onExitComplete={resetIntroTriggers}>
				{currentStep === "intro" && (
					<motion.div
						key="intro"
						initial={{ opacity: 0, filter: "blur(10px)", scale: 0.98 }}
						animate={{ opacity: 1, filter: "blur(0px)", scale: 1 }}
						exit={{ opacity: 0, filter: "blur(10px)", scale: 0.98 }}
						transition={{ duration: 0.28, ease: "easeInOut" }}
					>
						<Intro />
					</motion.div>
				)}
				{currentStep === "name" && (
					<motion.div
						key="name"
						initial={{ opacity: 0, filter: "blur(10px)", scale: 0.95 }}
						animate={{ opacity: 1, filter: "blur(0px)", scale: 1 }}
						exit={{ opacity: 0, filter: "blur(10px)", scale: 0.95 }}
						transition={{ duration: 0.3, ease: "easeOut" }}
					>
						<NameForm />
					</motion.div>
				)}
				{currentStep === "bio" && (
					<motion.div
						key="bio"
						initial={{ opacity: 0, filter: "blur(10px)", scale: 0.95 }}
						animate={{ opacity: 1, filter: "blur(0px)", scale: 1 }}
						exit={{ opacity: 0, filter: "blur(10px)", scale: 0.95 }}
						transition={{ duration: 0.3, ease: "easeOut" }}
					>
						<BioForm />
					</motion.div>
				)}
				{/*{currentStep === "connections" && (
                    <motion.div
                        key="connections"
                        initial={{ opacity: 0, filter: "blur(10px)", scale: 0.95 }}
                        animate={{ opacity: 1, filter: "blur(0px)", scale: 1 }}
                        exit={{ opacity: 0, filter: "blur(10px)", scale: 0.95 }}
                        transition={{ duration: 0.3, ease: "easeOut" }}
                    >
                        <ConnectionsForm />
                    </motion.div>
                )}*/}
				{currentStep === "mcp" && (
					<motion.div
						key="mcp"
						initial={{ opacity: 0, filter: "blur(10px)", scale: 0.95 }}
						animate={{ opacity: 1, filter: "blur(0px)", scale: 1 }}
						exit={{ opacity: 0, filter: "blur(10px)", scale: 0.95 }}
						transition={{ duration: 0.3, ease: "easeOut" }}
					>
						<MCPForm />
					</motion.div>
				)}
				{currentStep === "extension" && (
					<motion.div
						key="extension"
						initial={{ opacity: 0, filter: "blur(10px)", scale: 0.95 }}
						animate={{ opacity: 1, filter: "blur(0px)", scale: 1 }}
						exit={{ opacity: 0, filter: "blur(10px)", scale: 0.95 }}
						transition={{ duration: 0.3, ease: "easeOut" }}
					>
						<ExtensionForm />
					</motion.div>
				)}
				{currentStep === "welcome" && (
					<motion.div
						key="welcome"
						initial={{ opacity: 0, filter: "blur(10px)", scale: 0.95 }}
						animate={{ opacity: 1, filter: "blur(0px)", scale: 1 }}
						exit={{ opacity: 0, filter: "blur(10px)", scale: 0.95 }}
						transition={{ duration: 0.3, ease: "easeOut" }}
					>
						<Welcome />
					</motion.div>
				)}
			</AnimatePresence>
		</div>
	)
}