- {connection.maxAmount > 0 &&
- connection.budgetRenewal !== "never" ? (
- <>Renews {connection.budgetRenewal}>
- ) : (
-
-
-
-
+
+
+ {connection.maxAmount && (
+ <>{formatAmount(connection.maxAmount * 1000)} sats>
+ )}
-
- {connection.lastEventAt && (
-
-
-
Last used:
-
{dayjs(connection.lastEventAt).fromNow()}
-
+
+ {connection.maxAmount > 0 &&
+ connection.budgetRenewal !== "never" && (
+ <>Renews {connection.budgetRenewal}>
+ )}
- )}
+
>
)}
>
diff --git a/frontend/src/components/connections/AppCardNotice.tsx b/frontend/src/components/connections/AppCardNotice.tsx
index f3778c47..eb4f0aac 100644
--- a/frontend/src/components/connections/AppCardNotice.tsx
+++ b/frontend/src/components/connections/AppCardNotice.tsx
@@ -1,7 +1,8 @@
-import { ExclamationTriangleIcon } from "@radix-ui/react-icons";
import dayjs from "dayjs";
+import isBetween from "dayjs/plugin/isBetween"; // Add this line
+import { CalendarClock } from "lucide-react";
import { Link } from "react-router-dom";
-import { Button } from "src/components/ui/button";
+import { Badge } from "src/components/ui/badge";
import {
Tooltip,
TooltipContent,
@@ -10,47 +11,47 @@ import {
} from "src/components/ui/tooltip";
import { App } from "src/types";
+dayjs.extend(isBetween); // Extend dayjs with the isBetween plugin
+
type AppCardNoticeProps = {
app: App;
};
-const ONE_WEEK_IN_SECONDS = 8 * 24 * 60 * 60 * 1000;
-
export function AppCardNotice({ app }: AppCardNoticeProps) {
+ const now = dayjs();
+ const expiresAt = dayjs(app.expiresAt);
+ const isExpired = expiresAt.isBefore(now);
+ const expiresSoon = expiresAt.isBetween(now, now.add(7, "days"));
+
return (
{app.expiresAt ? (
- new Date(app.expiresAt).getTime() < new Date().getTime() ? (
+ isExpired ? (
-
+
+
+ Expired
+
-
- Expired {dayjs(app.expiresAt).fromNow()}
-
+ Expired {expiresAt.fromNow()}
- ) : new Date(app.expiresAt).getTime() - ONE_WEEK_IN_SECONDS <
- new Date().getTime() ? (
+ ) : expiresSoon ? (
-
+
+
+ Expires Soon
+
-
- Expires {dayjs(app.expiresAt).fromNow()}
-
+ Expires {expiresAt.fromNow()}
) : null
diff --git a/frontend/src/screens/apps/AppList.tsx b/frontend/src/screens/apps/AppList.tsx
index 37ab383f..8d417669 100644
--- a/frontend/src/screens/apps/AppList.tsx
+++ b/frontend/src/screens/apps/AppList.tsx
@@ -52,7 +52,7 @@ function AppList() {
)}
{otherApps.length > 0 && (
-
+
{otherApps.map((app, index) => (
))}