@@ -3,14 +3,15 @@ import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
3
3
import { Button } from "@/components/ui/button" ;
4
4
import { motion } from "framer-motion" ;
5
5
import { STAGGER_CHILD_VARIANTS } from "@/lib/constants" ;
6
- import CheckCircle2 from "@/components/shared/icons/check-cirlce-2" ;
7
6
import { capitalize } from "@/lib/utils" ;
8
7
import { PLANS } from "@/lib/stripe/utils" ;
9
8
import { getStripe } from "@/lib/stripe/client" ;
10
9
import { Badge } from "../ui/badge" ;
11
10
import { useTeam } from "@/context/team-context" ;
12
11
import { useAnalytics } from "@/lib/analytics" ;
13
12
import React from "react" ;
13
+ import { Tabs , TabsList , TabsTrigger } from "@/components/ui/tabs" ;
14
+ import { CheckIcon } from "lucide-react" ;
14
15
15
16
export function UpgradePlanModal ( {
16
17
clickedPlan,
@@ -19,28 +20,55 @@ export function UpgradePlanModal({
19
20
setOpen,
20
21
children,
21
22
} : {
22
- clickedPlan : "Enterprise " | "Pro" ;
23
+ clickedPlan : "Business " | "Pro" ;
23
24
trigger ?: string ;
24
25
open ?: boolean ;
25
26
setOpen ?: React . Dispatch < React . SetStateAction < boolean > > ;
26
27
children ?: React . ReactNode ;
27
28
} ) {
28
- const [ plan , setPlan ] = useState < "Pro" | "Enterprise " > ( clickedPlan ) ;
29
+ const [ plan , setPlan ] = useState < "Pro" | "Business " > ( clickedPlan ) ;
29
30
const [ period , setPeriod ] = useState < "monthly" | "yearly" > ( "monthly" ) ;
30
31
const [ clicked , setClicked ] = useState < boolean > ( false ) ;
31
32
const teamInfo = useTeam ( ) ;
32
33
const analytics = useAnalytics ( ) ;
33
34
34
35
const features = useMemo ( ( ) => {
36
+ if ( plan === "Pro" ) {
37
+ return [
38
+ "Folders" ,
39
+ "3 team members" ,
40
+ "Unlimited link views" ,
41
+ "Custom domains" ,
42
+ "Custom branding" ,
43
+ "Notion documents" ,
44
+ "AI Document Assistant incl. 1500 credits" ,
45
+ ] ;
46
+ }
47
+
48
+ if ( plan === "Business" ) {
49
+ return [
50
+ "Unlimited subfolder levels" ,
51
+ "10 team members" ,
52
+ "Unlimited documents" ,
53
+ "Unlimited link views" ,
54
+ "Custom domains" ,
55
+ "Custom branding" ,
56
+ "Notion documents" ,
57
+ "Data room (coming soon)" ,
58
+ "Shareable folders (coming soon)" ,
59
+ "AI Document Assistant incl. 2500 credits" ,
60
+ "Priority Support" ,
61
+ ] ;
62
+ }
63
+
35
64
return [
65
+ "Folders" ,
66
+ "3 team members" ,
67
+ "Unlimited link views" ,
36
68
"Custom domains" ,
37
69
"Custom branding" ,
38
70
"Notion documents" ,
39
- "Unlimited link views" ,
40
- "Unlimited documents" ,
41
- "Team members" ,
42
71
"AI Document Assistant incl. 1500 credits" ,
43
- ...( plan === "Enterprise" ? [ "Priority Support" ] : [ ] ) ,
44
72
] ;
45
73
} , [ plan ] ) ;
46
74
@@ -103,7 +131,18 @@ export function UpgradePlanModal({
103
131
Enjoy higher limits and extra features with our { plan } plan.
104
132
</ motion . p >
105
133
</ motion . div >
106
- < div className = "bg-background px-4 py-8 text-left sm:px-16" >
134
+
135
+ < div className = "bg-background px-4 pb-8 text-left sm:px-16" >
136
+ < Tabs className = "pb-4" defaultValue = { plan } >
137
+ < TabsList className = "grid w-full grid-cols-2" >
138
+ < TabsTrigger value = "Pro" onClick = { ( ) => setPlan ( "Pro" ) } >
139
+ Pro
140
+ </ TabsTrigger >
141
+ < TabsTrigger value = "Business" onClick = { ( ) => setPlan ( "Business" ) } >
142
+ Business
143
+ </ TabsTrigger >
144
+ </ TabsList >
145
+ </ Tabs >
107
146
< motion . div
108
147
className = "flex flex-col space-y-3"
109
148
variants = { STAGGER_CHILD_VARIANTS }
@@ -121,17 +160,15 @@ export function UpgradePlanModal({
121
160
className = "text-sm font-normal normal-case"
122
161
> { `€${
123
162
PLANS . find ( ( p ) => p . name === plan ) ! . price [ period ] . amount
124
- } /month `} </ Badge >
163
+ } /${ period . replace ( "ly" , "" ) } `} </ Badge >
125
164
</ div >
126
165
< button
127
166
onClick = { ( ) => {
128
167
setPeriod ( period === "monthly" ? "yearly" : "monthly" ) ;
129
168
} }
130
169
className = "text-xs text-muted-foreground underline underline-offset-4 transition-colors hover:text-gray-800 hover:dark:text-muted-foreground/80"
131
170
>
132
- { period === "monthly"
133
- ? "Get 2 months free 🎁"
134
- : "Switch to monthly" }
171
+ { period === "monthly" ? "Want 20% off?" : "Switch to monthly" }
135
172
</ button >
136
173
</ div >
137
174
< motion . div
@@ -150,9 +187,12 @@ export function UpgradePlanModal({
150
187
< motion . div
151
188
key = { i }
152
189
variants = { STAGGER_CHILD_VARIANTS }
153
- className = "flex items-center space -x-2 text-sm text-muted-foreground"
190
+ className = "flex items-center gap -x-3 text-sm text-muted-foreground"
154
191
>
155
- < CheckCircle2 className = "h-5 w-5 text-emerald-500" />
192
+ < CheckIcon
193
+ className = "h-5 w-5 flex-none text-[#fb7a00]"
194
+ aria-hidden = "true"
195
+ />
156
196
< span > { feature } </ span >
157
197
</ motion . div >
158
198
) ) }
@@ -194,16 +234,7 @@ export function UpgradePlanModal({
194
234
target = "_blank"
195
235
className = "text-center text-xs text-muted-foreground underline-offset-4 transition-all hover:text-gray-800 hover:dark:text-muted-foreground/80 hover:underline"
196
236
>
197
- Papermark Enterprise
198
- </ a >
199
- < p className = "text-muted-foreground" > •</ p >
200
- < a
201
- href = { `${ process . env . NEXT_PUBLIC_BASE_URL } /pricing` }
202
- target = "_blank"
203
- rel = "noopener noreferrer"
204
- className = "text-center text-xs text-muted-foreground underline-offset-4 transition-all hover:text-gray-800 hover:dark:text-muted-foreground/80 hover:underline"
205
- >
206
- Compare plans
237
+ Looking for Papermark Enterprise?
207
238
</ a >
208
239
</ div >
209
240
</ motion . div >
0 commit comments