autumn-js
Version:
Autumn JS Library
63 lines (59 loc) • 1.68 kB
JavaScript
"use client";
// src/libraries/react/components/pricing-table/lib/pricing-table-content.tsx
import { jsx } from "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__ */ jsx("p", { children: "Start Free Trial" })
};
}
switch (scenario) {
case "scheduled":
return {
buttonText: /* @__PURE__ */ jsx("p", { children: "Plan Scheduled" })
};
case "active":
if (updateable) {
return {
buttonText: /* @__PURE__ */ jsx("p", { children: "Update Plan" })
};
}
return {
buttonText: /* @__PURE__ */ jsx("p", { children: "Current Plan" })
};
case "new":
if (is_one_off) {
return {
buttonText: /* @__PURE__ */ jsx("p", { children: "Purchase" })
};
}
return {
buttonText: /* @__PURE__ */ jsx("p", { children: "Get started" })
};
case "renew":
return {
buttonText: /* @__PURE__ */ jsx("p", { children: "Renew" })
};
case "upgrade":
return {
buttonText: /* @__PURE__ */ jsx("p", { children: "Upgrade" })
};
case "downgrade":
return {
buttonText: /* @__PURE__ */ jsx("p", { children: "Downgrade" })
};
case "cancel":
return {
buttonText: /* @__PURE__ */ jsx("p", { children: "Cancel Plan" })
};
default:
return {
buttonText: /* @__PURE__ */ jsx("p", { children: "Get Started" })
};
}
};
export {
getPricingTableContent
};