@@ -13,13 +13,15 @@ interface FeatureWaitlistProps {
1313 title ?: string ;
1414 description ?: string ;
1515 organizationId ?: string ;
16+ variant ?: "card" | "flat" ;
1617}
1718
1819export function FeatureWaitlist ( {
1920 feature,
2021 title = "Join the Waitlist" ,
2122 description = "Be the first to know when this feature becomes available." ,
2223 organizationId,
24+ variant = "card" ,
2325} : FeatureWaitlistProps ) {
2426 const user = useHeliconeAuthClient ( ) ;
2527
@@ -80,32 +82,84 @@ export function FeatureWaitlist({
8082 } ;
8183
8284 if ( isOnWaitlist ?. data ?. isOnWaitlist ) {
85+ const content = (
86+ < div className = "flex flex-col items-center gap-4 py-8 text-center" >
87+ < div className = "flex h-12 w-12 items-center justify-center rounded-full bg-green-100 dark:bg-green-900/30" >
88+ < CheckIcon className = "h-6 w-6 text-green-600 dark:text-green-400" />
89+ </ div >
90+ < div >
91+ < H3 className = "mb-2" > You‘re on the list!</ H3 >
92+ < P className = "text-muted-foreground" >
93+ We‘ll notify you at < strong > { email } </ strong > when this
94+ feature is available.
95+ </ P >
96+ </ div >
97+ </ div >
98+ ) ;
99+
100+ if ( variant === "flat" ) {
101+ return < div className = "w-full" > { content } </ div > ;
102+ }
103+
83104 return (
84105 < Card className = "w-full" >
85- < CardContent className = "pt-6" >
86- < div className = "flex flex-col items-center gap-4 py-8 text-center" >
87- < div className = "flex h-12 w-12 items-center justify-center rounded-full bg-green-100 dark:bg-green-900/30" >
88- < CheckIcon className = "h-6 w-6 text-green-600 dark:text-green-400" />
89- </ div >
90- < div >
91- < H3 className = "mb-2" > You‘re on the list!</ H3 >
92- < P className = "text-muted-foreground" >
93- We‘ll notify you at < strong > { email } </ strong > when this
94- feature is available.
95- </ P >
96- </ div >
97- </ div >
98- </ CardContent >
106+ < CardContent className = "pt-6" > { content } </ CardContent >
99107 </ Card >
100108 ) ;
101109 }
102110
111+ const content = (
112+ < >
113+ < div className = "flex items-center gap-3 mb-4" >
114+ < div className = "flex h-10 w-10 items-center justify-center rounded-lg border border-border" >
115+ < Mail className = "h-5 w-5 text-muted-foreground" />
116+ </ div >
117+ < div >
118+ < H3 > { title } </ H3 >
119+ < Small className = "text-muted-foreground" > { description } </ Small >
120+ </ div >
121+ </ div >
122+ < form onSubmit = { handleSubmit } className = "flex flex-col gap-4" >
123+ < div className = "flex flex-col gap-2" >
124+ < Input
125+ type = "email"
126+ placeholder = "Enter your email"
127+ value = { email }
128+ disabled = { true }
129+ className = "w-full"
130+ aria-label = "Email address"
131+ />
132+ { error && < Small className = "text-destructive" > { error } </ Small > }
133+ </ div >
134+ < Button
135+ type = "submit"
136+ variant = "secondary"
137+ disabled = { isPending || ! email }
138+ className = "w-full"
139+ >
140+ { isPending ? (
141+ < >
142+ < Loader2 className = "mr-2 h-4 w-4 animate-spin" />
143+ Joining...
144+ </ >
145+ ) : (
146+ "Join Waitlist"
147+ ) }
148+ </ Button >
149+ </ form >
150+ </ >
151+ ) ;
152+
153+ if ( variant === "flat" ) {
154+ return < div className = "w-full" > { content } </ div > ;
155+ }
156+
103157 return (
104158 < Card className = "w-full" >
105159 < CardHeader >
106160 < div className = "flex items-center gap-3" >
107- < div className = "flex h-10 w-10 items-center justify-center rounded-lg bg-blue-100 dark:bg-blue-900/30 " >
108- < Mail className = "h-5 w-5 text-blue-600 dark:text-blue-400 " />
161+ < div className = "flex h-10 w-10 items-center justify-center rounded-lg border border-border " >
162+ < Mail className = "h-5 w-5 text-muted-foreground " />
109163 </ div >
110164 < div >
111165 < H3 > { title } </ H3 >
0 commit comments