3
3
CircleX ,
4
4
EditIcon ,
5
5
ExternalLinkIcon ,
6
+ InfoIcon ,
6
7
Link2Icon ,
8
+ User2Icon ,
7
9
ZapIcon ,
8
10
} from "lucide-react" ;
9
11
import { FormEvent , useState } from "react" ;
@@ -34,6 +36,12 @@ import {
34
36
} from "src/components/ui/dialog" ;
35
37
import { LoadingButton } from "src/components/ui/loading-button" ;
36
38
import { Separator } from "src/components/ui/separator" ;
39
+ import {
40
+ Tooltip ,
41
+ TooltipContent ,
42
+ TooltipProvider ,
43
+ TooltipTrigger ,
44
+ } from "src/components/ui/tooltip" ;
37
45
import { useAlbyMe } from "src/hooks/useAlbyMe" ;
38
46
import { LinkStatus , useLinkAccount } from "src/hooks/useLinkAccount" ;
39
47
import { App , BudgetRenewalType } from "src/types" ;
@@ -149,15 +157,25 @@ function AlbyConnectionCard({ connection }: { connection?: App }) {
149
157
</ Button >
150
158
)
151
159
) }
152
- < ExternalLink
153
- to = "https://www.getalby.com/node"
154
- className = "w-full sm:w-auto"
155
- >
156
- < Button variant = "outline" className = "w-full sm:w-auto" >
157
- < ExternalLinkIcon className = "w-4 h-4 mr-2" />
158
- Alby Account Settings
159
- </ Button >
160
- </ ExternalLink >
160
+ { ! connection && (
161
+ < ExternalLink
162
+ to = "https://www.getalby.com/node"
163
+ className = "w-full sm:w-auto"
164
+ >
165
+ < Button variant = "outline" className = "w-full sm:w-auto" >
166
+ < ExternalLinkIcon className = "w-4 h-4 mr-2" />
167
+ Alby Account Settings
168
+ </ Button >
169
+ </ ExternalLink >
170
+ ) }
171
+ { connection && (
172
+ < Link to = "/settings/alby-account" className = "w-full sm:w-auto" >
173
+ < Button variant = "outline" className = "w-full sm:w-auto" >
174
+ < User2Icon className = "w-4 h-4 mr-2" />
175
+ Alby Account Settings
176
+ </ Button >
177
+ </ Link >
178
+ ) }
161
179
</ div >
162
180
</ div >
163
181
{ connection && (
@@ -168,7 +186,30 @@ function AlbyConnectionCard({ connection }: { connection?: App }) {
168
186
>
169
187
< EditIcon className = "w-4 h-4 hidden group-hover:inline text-muted-foreground hover:text-card-foreground" />
170
188
</ Link >
171
- < AppCardConnectionInfo connection = { connection } />
189
+ < AppCardConnectionInfo
190
+ connection = { connection }
191
+ budgetRemainingText = {
192
+ < span className = "flex items-center gap-2 justify-end" >
193
+ Left in Alby Account budget
194
+ < TooltipProvider >
195
+ < Tooltip >
196
+ < TooltipTrigger >
197
+ < div className = "flex flex-row items-center" >
198
+ < InfoIcon className = "h-4 w-4 shrink-0 text-muted-foreground" />
199
+ </ div >
200
+ </ TooltipTrigger >
201
+ < TooltipContent className = "max-w-sm" >
202
+ Control what access your Alby Account has to your Hub
203
+ by editing the budget. Every app you access through
204
+ your Alby Account (such as your lightning address,
205
+ Alby Extension, podcasting 2.0 apps) will handle
206
+ payments via your Hub.
207
+ </ TooltipContent >
208
+ </ Tooltip >
209
+ </ TooltipProvider >
210
+ </ span >
211
+ }
212
+ />
172
213
</ div >
173
214
) }
174
215
</ div >
0 commit comments