subos-frontend 1.0.82 → 1.0.84

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
@@ -612,13 +612,15 @@ var usePlans = () => {
612
612
  const handlePlanSelect = React10.useCallback((plan) => {
613
613
  setSelectedPlan(plan);
614
614
  }, []);
615
- const handleUpgrade = React10.useCallback(async (externalId) => {
615
+ const handleUpgrade = React10.useCallback(async (externalId, options) => {
616
616
  var _a;
617
617
  if (!selectedPlan) return;
618
618
  try {
619
619
  const response = await plansApi.createPaymentSession(selectedPlan.code, {
620
620
  externalId,
621
- currency
621
+ currency,
622
+ returnUrl: options == null ? void 0 : options.returnUrl,
623
+ cancelUrl: options == null ? void 0 : options.cancelUrl
622
624
  // billableMetricCode: "CANDIDATES"
623
625
  });
624
626
  if (response.success && ((_a = response.data) == null ? void 0 : _a.checkoutUrl)) {
@@ -3006,8 +3008,7 @@ var UpgradeSummary = ({
3006
3008
  proration: 0,
3007
3009
  // No proration for current plan
3008
3010
  planCode: currentPlan.code,
3009
- planCurrency: "USD",
3010
- // Default currency
3011
+ planCurrency: currentPlan.currency,
3011
3012
  contactSupport: false
3012
3013
  };
3013
3014
  setCheckoutInfo(mockCheckoutInfo);
@@ -3041,7 +3042,8 @@ var UpgradeSummary = ({
3041
3042
  const intervalDisplay = displayInfo.planInterval === "MONTHLY" ? "Mo" : "Yr";
3042
3043
  const dueToday = displayInfo.proration > 0 ? displayInfo.proration : displayInfo.planPrice;
3043
3044
  const shouldContactSupport = !!displayInfo.contactSupport;
3044
- const currencySymbol = getCurrencySymbol(displayInfo.planCurrency);
3045
+ const currencyCode = displayInfo.planCurrency || (currentPlan == null ? void 0 : currentPlan.currency) || currency;
3046
+ const currencySymbol = getCurrencySymbol(currencyCode);
3045
3047
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
3046
3048
  "div",
3047
3049
  {
@@ -3330,7 +3332,7 @@ var Pagination = ({
3330
3332
  var DashboardPage = ({
3331
3333
  externalId
3332
3334
  }) => {
3333
- var _a, _b, _c;
3335
+ var _a, _b, _c, _d;
3334
3336
  const subscription = useSubscription();
3335
3337
  const plans = usePlans();
3336
3338
  const lastLoadedIdRef = React10.useRef(null);
@@ -3395,11 +3397,12 @@ var DashboardPage = ({
3395
3397
  isDefault: false,
3396
3398
  intervalCount: 1,
3397
3399
  projectId: "",
3398
- charges: subscription.subscription.plan.charges || []
3400
+ charges: subscription.subscription.plan.charges || [],
3401
+ currency: (_c = subscription.subscription) == null ? void 0 : _c.currency
3399
3402
  } : null,
3400
3403
  externalId,
3401
3404
  onUpgrade: handleUpgrade,
3402
- isVisible: !!plans.selectedPlan || !!((_c = subscription.subscription) == null ? void 0 : _c.plan)
3405
+ isVisible: !!plans.selectedPlan || !!((_d = subscription.subscription) == null ? void 0 : _d.plan)
3403
3406
  }
3404
3407
  )
3405
3408
  ] }) }) });