subos-frontend 1.0.102 → 1.0.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/components/subscription/index.d.ts +2 -0
- package/dist/types/components/subscription/index.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/planUtils.d.ts +9 -0
- package/dist/types/utils/planUtils.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -617,6 +617,27 @@ var formatDate = (dateString, format = "date") => {
|
|
|
617
617
|
day: "numeric"
|
|
618
618
|
}).format(date);
|
|
619
619
|
};
|
|
620
|
+
var getGracePeriodInfo = (subscription) => {
|
|
621
|
+
var _a;
|
|
622
|
+
if (!((_a = subscription == null ? void 0 : subscription.meta) == null ? void 0 : _a.isGracePeriod)) {
|
|
623
|
+
return null;
|
|
624
|
+
}
|
|
625
|
+
const startDate = subscription.meta.gracePeriodStart;
|
|
626
|
+
const endDate = subscription.meta.gracePeriodEnd;
|
|
627
|
+
let remainingDays = subscription.remainingGracePeriodDays ?? 0;
|
|
628
|
+
if (endDate) {
|
|
629
|
+
const end = new Date(endDate).getTime();
|
|
630
|
+
const now = (/* @__PURE__ */ new Date()).getTime();
|
|
631
|
+
const diff = end - now;
|
|
632
|
+
remainingDays = Math.max(0, Math.ceil(diff / (1e3 * 60 * 60 * 24)));
|
|
633
|
+
}
|
|
634
|
+
return {
|
|
635
|
+
startDate,
|
|
636
|
+
endDate,
|
|
637
|
+
remainingDays,
|
|
638
|
+
message: `Your 7-day grace period started on ${startDate ? formatDate(startDate) : "N/A"}. You have ${remainingDays} days remaining to update your payment method to continue your subscription without interruption.`
|
|
639
|
+
};
|
|
640
|
+
};
|
|
620
641
|
|
|
621
642
|
// src/hooks/usePlans.ts
|
|
622
643
|
var usePlans = () => {
|
|
@@ -3719,6 +3740,7 @@ exports.DeleteIcon = DeleteIcon;
|
|
|
3719
3740
|
exports.DownloadIcon = DownloadIcon;
|
|
3720
3741
|
exports.EmailIcon = EmailIcon;
|
|
3721
3742
|
exports.FilterIcon = FilterIcon;
|
|
3743
|
+
exports.GracePeriodNotification = GracePeriodNotification;
|
|
3722
3744
|
exports.Layout = Layout;
|
|
3723
3745
|
exports.LoadingSpinner = LoadingSpinner;
|
|
3724
3746
|
exports.LogoInline = LogoInline;
|
|
@@ -3767,6 +3789,7 @@ exports.getApiBaseUrl = getApiBaseUrl;
|
|
|
3767
3789
|
exports.getCandidateUnits = getCandidateUnits;
|
|
3768
3790
|
exports.getCurrentSelectionText = getCurrentSelectionText;
|
|
3769
3791
|
exports.getDropdownOptions = getDropdownOptions;
|
|
3792
|
+
exports.getGracePeriodInfo = getGracePeriodInfo;
|
|
3770
3793
|
exports.getPlanDescription = getPlanDescription;
|
|
3771
3794
|
exports.getPlanFeatures = getPlanFeatures;
|
|
3772
3795
|
exports.getProjectId = getProjectId;
|