+
+
+
+
+ {expanded ? (
+
+ ) : (
+
+ )}
+
+
-
- {subscriptions.map((subscription) => {
- const daysLeft = getDaysLeft(subscription)
- const statusUpper = subscription.status.toUpperCase()
- const isActive =
- subscription.is_currently_active || statusUpper === "ACTIVE"
- const cancelEnabled =
- canCancel && isActive && statusUpper !== "CANCELLED"
+ {expanded ? (
+
+
+ {subscriptions.map((subscription) => {
+ const daysLeft = getDaysLeft(subscription)
+ const statusUpper = subscription.status.toUpperCase()
+ const isActive =
+ subscription.is_currently_active || statusUpper === "ACTIVE"
+ const cancelEnabled =
+ canCancel && isActive && statusUpper !== "CANCELLED"
- return (
-
-
-
-
- {formatPlanTitle(subscription)}
-
-
- {formatPlanCategory(subscription.plan_category)} · Expires{" "}
- {formatExpiryDate(subscription)}
- {daysLeft != null ? ` · ${formatDaysLeftLabel(daysLeft)}` : ""}
-
+ return (
+
+
+
+
+ {formatPlanTitle(subscription)}
+
+
+ {formatPlanCategory(subscription.plan_category)} · Expires{" "}
+ {formatExpiryDate(subscription)}
+ {daysLeft != null ? ` · ${formatDaysLeftLabel(daysLeft)}` : ""}
+
+
+
+
+ {canCancel ? (
+
+ ) : null}
+
+
-
-
- {canCancel ? (
-
- ) : null}
-
-
-
- )
- })}
-
+ )
+ })}
+
-
- {canExtend ? (
-
- ) : null}
+
+ {canExtend ? (
+
+ ) : null}
- {canGrant ? (
-
- ) : null}
-
+ {canGrant ? (
+
+ ) : null}
+
+
+ ) : null}
)
}
@@ -288,65 +305,81 @@ function EmptySubscriptionCard({
grantEnabled: boolean
onGrant: () => void
}) {
+ const [expanded, setExpanded] = useState(true)
const upper = displayStatus.toUpperCase()
const tone =
upper === "ACTIVE" ? "active" : upper === "PENDING" ? "pending" : "inactive"
return (
-
-
+
+
-
-
No active subscription for this learner.
-
-
- {canExtend ? (
-
- ) : null}
- {(canGrant || canCancel) && (
-
- {canGrant ? (
+
+
+ {expanded ? (
+
+ ) : (
+
+ )}
+
+
+
+ {expanded ? (
+
+
No active subscription for this learner.
+
+ {canExtend ? (
- ) : null}
- {canCancel ? (
-
) : null}
+ {(canGrant || canCancel) && (
+
+ {canGrant ? (
+
+ ) : null}
+ {canCancel ? (
+
+ ) : null}
+
+ )}
- )}
-
+
+ ) : null}
)
}