subos-frontend 1.0.111 → 1.0.112

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 CHANGED
@@ -3038,13 +3038,17 @@ var ScheduledPlanNotification = ({
3038
3038
  return null;
3039
3039
  }
3040
3040
  const formatInterval = (interval) => {
3041
+ if (!interval) return "";
3041
3042
  return interval.charAt(0).toUpperCase() + interval.slice(1).toLowerCase();
3042
3043
  };
3043
3044
  const nextPlan = subscription.nextMembership.plan;
3044
- const metrics = nextPlan.charges && nextPlan.charges.length > 0 ? `(${nextPlan.charges.map(
3045
+ if (!nextPlan || !nextPlan.name) {
3046
+ return null;
3047
+ }
3048
+ const metrics = nextPlan.charges && Array.isArray(nextPlan.charges) && nextPlan.charges.length > 0 ? `(${nextPlan.charges.map(
3045
3049
  (charge) => {
3046
- var _a, _b;
3047
- return `${charge.billableMetric.name}: ${((_b = (_a = charge.properties) == null ? void 0 : _a.units) == null ? void 0 : _b.toLocaleString()) || 0}`;
3050
+ var _a, _b, _c;
3051
+ return `${((_a = charge.billableMetric) == null ? void 0 : _a.name) || "Metric"}: ${((_c = (_b = charge.properties) == null ? void 0 : _b.units) == null ? void 0 : _c.toLocaleString()) || 0}`;
3048
3052
  }
3049
3053
  ).join(", ")}) ` : "";
3050
3054
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `mb-4 p-4 bg-yellow-50 border border-yellow-200 rounded-md flex items-start gap-3 ${className}`, children: [