autumn-js
Version:
Autumn JS Library
86 lines (83 loc) • 3.03 kB
JavaScript
"use client";
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/libraries/react/components/pricing-table/lib/pricing-table-content.tsx
var pricing_table_content_exports = {};
__export(pricing_table_content_exports, {
getPricingTableContent: () => getPricingTableContent
});
module.exports = __toCommonJS(pricing_table_content_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var getPricingTableContent = (product) => {
const { scenario, free_trial, properties } = product;
const { is_one_off, updateable, has_trial } = properties;
if (has_trial) {
return {
buttonText: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Start Free Trial" })
};
}
switch (scenario) {
case "scheduled":
return {
buttonText: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Plan Scheduled" })
};
case "active":
if (updateable) {
return {
buttonText: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Update Plan" })
};
}
return {
buttonText: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Current Plan" })
};
case "new":
if (is_one_off) {
return {
buttonText: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Purchase" })
};
}
return {
buttonText: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Get started" })
};
case "renew":
return {
buttonText: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Renew" })
};
case "upgrade":
return {
buttonText: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Upgrade" })
};
case "downgrade":
return {
buttonText: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Downgrade" })
};
case "cancel":
return {
buttonText: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Cancel Plan" })
};
default:
return {
buttonText: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Get Started" })
};
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getPricingTableContent
});