diff --git a/frontend/src/components/connections/AppLinksCard.tsx b/frontend/src/components/connections/AppLinksCard.tsx index 10eaf396..b79062ed 100644 --- a/frontend/src/components/connections/AppLinksCard.tsx +++ b/frontend/src/components/connections/AppLinksCard.tsx @@ -13,15 +13,66 @@ import { } from "src/components/ui/card"; import { ExternalLinkButton } from "src/components/ui/custom/external-link-button"; +function hasAppLinks(appStoreApp: AppStoreApp) { + return !!( + appStoreApp.appleLink || + appStoreApp.playLink || + appStoreApp.zapStoreLink || + appStoreApp.chromeLink || + appStoreApp.firefoxLink || + appStoreApp.webLink + ); +} + +export function AppLinks({ appStoreApp }: { appStoreApp: AppStoreApp }) { + if (!hasAppLinks(appStoreApp)) { + return null; + } + + return ( +
-
+ Isolated Balance +
+
+
- Create a lightning address for this particular app - connection -
-- {app.metadata.lud16} -
-
-
-
- Left in budget -
-
-
- Budget renewal -
-
-
+ Total Spent +
+
+
+ Total Received +
+
+
+ Left in budget +
+
+
+ Budget renewal +
+
+
+ {app.metadata.lud16} +
++ This app has full access and can create other connections to your + wallet. +
+ ); + } + + const canSpend = scopes.includes("pay_invoice"); + const secondary = getSecondaryAbilities(scopes); + + if (!canSpend && !secondary.length) { + returnThis app has no access to your wallet.
; + } + + if (!canSpend) { + returnThis app can {formatList(secondary)}.
; + } + + return ( +
+ This app can send payments
+ {maxAmountSat > 0 ? (
+ <>
+ {" "}
+ up to{" "}
+
+
Permissions
+ +Expires {new Date(app.expiresAt).toLocaleDateString()}
+ )} ++ {appStoreApp.extendedDescription} +
+