aboutsummaryrefslogtreecommitdiff
path: root/apps/web/components/new/onboarding/welcome/continue-step.tsx
blob: 7d56d30e4280de094037b8160350d57a1650f2b0 (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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
import { dmSansClassName } from "@/lib/fonts"
import { cn } from "@lib/utils"
import { Button } from "@ui/components/button"
import { motion, type Variants } from "motion/react"
import { useRouter } from "next/navigation"
import { ProfileStep } from "./profile-step"
import { continueVariants, contentVariants } from "@/lib/variants"

type OnboardingView = "continue" | "features" | "memories"

interface OnboardingContentStepProps {
	currentView?: OnboardingView
	onSubmit?: (data: {
		twitter: string
		linkedin: string
		description: string
		otherLinks: string[]
	}) => void
}

const containerVariants: Variants = {
	visible: {
		opacity: 1,
		y: 0,
		transition: {
			duration: 0.4,
			ease: "easeOut",
		},
	},
	hidden: {
		opacity: 0,
		transition: {
			duration: 0,
		},
	},
}

export function OnboardingContentStep({
	currentView = "continue",
	onSubmit,
}: OnboardingContentStepProps) {
	const router = useRouter()

	const handleContinue = () => {
		router.push("/new/onboarding/welcome?step=features")
	}

	const handleAddMemories = () => {
		router.push("/new/onboarding/welcome?step=memories")
	}

	const isContinue = currentView === "continue"
	const isFeatures = currentView === "features"
	const isMemories = currentView === "memories"

	return (
		<motion.div
			variants={containerVariants}
			initial="hidden"
			animate="visible"
			exit="hidden"
			className="text-center relative"
		>
			{/* Continue content */}
			<motion.div
				variants={continueVariants}
				animate={isContinue ? "visible" : "hidden"}
				initial="visible"
				className={cn(
					"flex flex-col items-center justify-center max-w-88",
					!isContinue && "absolute inset-0 pointer-events-none",
				)}
			>
				<p
					className={cn(
						"text-[#8A8A8A] text-sm mb-6 max-w-sm",
						dmSansClassName(),
					)}
				>
					I'm built with Supermemory's super fast memory API,
					<br /> so you never have to worry about forgetting <br /> what matters
					across your AI apps.
				</p>
				<Button
					variant="onboarding"
					onClick={handleContinue}
					style={{
						background: "linear-gradient(180deg, #0D121A -26.14%, #000 100%)",
						width: "147px",
					}}
				>
					Continue 
				</Button>
			</motion.div>

			{/* Features content */}
			<motion.div
				variants={contentVariants}
				animate={isFeatures ? "visible" : "hiddenDown"}
				initial="hiddenDown"
				className={cn(
					"space-y-6 max-w-88",
					!isFeatures && "absolute inset-0 pointer-events-none",
				)}
			>
				<h2 className="text-white text-[32px] font-medium leading-[110%]">
					What I can do for you
				</h2>

				<div className={cn("space-y-4 mb-[24px] mx-4", dmSansClassName())}>
					<div className="flex items-start space-x-2">
						<div className="w-14 h-14 rounded-lg flex items-center justify-center shrink-0">
							<img
								src="/onboarding/human-brain.png"
								alt="Brain icon"
								className="w-14 h-14"
							/>
						</div>
						<div className="text-left">
							<p className="text-white font-light">Remember every context</p>
							<p className="text-[#8A8A8A] text-[14px]">
								I keep track of what you've saved and shared with your
								supermemory.
							</p>
						</div>
					</div>

					<div className="flex items-start space-x-2">
						<div className="w-14 h-14 rounded-lg flex items-center justify-center shrink-0">
							<img
								src="/onboarding/search.png"
								alt="Search icon"
								className="w-14 h-14"
							/>
						</div>
						<div className="text-left">
							<p className="text-white font-light">Find when you need it</p>
							<p className="text-[#8A8A8A] text-[14px]">
								I surface the right memories inside <br /> your supermemory,
								superfast.
							</p>
						</div>
					</div>

					<div className="flex items-start space-x-2">
						<div className="w-14 h-14 rounded-lg flex items-center justify-center shrink-0">
							<img
								src="/onboarding/plant.png"
								alt="Growth icon"
								className="w-14 h-14"
							/>
						</div>
						<div className="text-left">
							<p className="text-white font-light">
								Grow with your supermemory
							</p>
							<p className="text-[#8A8A8A] text-[14px]">
								I learn and personalize over time, so every interaction feels
								natural.
							</p>
						</div>
					</div>
				</div>

				<Button
					variant="onboarding"
					style={{
						background: "linear-gradient(180deg, #0D121A -26.14%, #000 100%)",
					}}
					onClick={handleAddMemories}
				>
					Add memories 
				</Button>
			</motion.div>

			{/* Memories/Profile content */}
			<div
				className={cn(
					"w-full",
					!isMemories && "absolute inset-0 pointer-events-none",
				)}
			>
				{onSubmit && (
					<motion.div
						variants={contentVariants}
						animate={isMemories ? "visible" : "hiddenDown"}
						initial="hiddenDown"
					>
						<ProfileStep onSubmit={onSubmit} />
					</motion.div>
				)}
			</div>
		</motion.div>
	)
}