@startsimpli/billing 0.4.7 → 0.4.9
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/package.json +1 -1
- package/src/components/PricingDetailPage.integration.test.tsx +27 -27
- package/src/components/PricingDetailPage.test.tsx +36 -36
- package/src/components/PricingDetailPage.tsx +8 -8
- package/src/components/PricingPage.test.tsx +36 -36
- package/src/components/PricingPage.tsx +7 -7
- package/src/components/PricingSection.test.tsx +36 -36
- package/src/components/PricingSection.tsx +7 -7
- package/src/components/SubscriptionManager.test.tsx +58 -58
- package/src/components/SubscriptionManager.tsx +15 -15
- package/src/components/UpgradeModal.test.tsx +12 -12
- package/src/components/UpgradeModal.tsx +8 -8
- package/src/hooks/useCheckout.test.tsx +6 -6
- package/src/hooks/useProduct.test.tsx +24 -24
- package/src/hooks/useSubscription.test.tsx +16 -16
- package/src/server/index.ts +1 -1
- package/src/server/proxy.test.ts +93 -0
- package/src/server/proxy.ts +23 -2
- package/src/types/index.ts +30 -30
- package/src/utils/api.test.ts +3 -3
package/package.json
CHANGED
|
@@ -22,45 +22,45 @@ const mockProduct: BillingProduct = {
|
|
|
22
22
|
id: "offer-1",
|
|
23
23
|
name: "Starter",
|
|
24
24
|
slug: "starter-monthly",
|
|
25
|
-
|
|
25
|
+
unitPrice: "0.00",
|
|
26
26
|
currency: "USD",
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
pricingModel: "flat",
|
|
28
|
+
intervalUnit: "month",
|
|
29
|
+
intervalCount: 1,
|
|
30
|
+
intervalDisplay: "per month",
|
|
31
|
+
isRecurring: true,
|
|
32
|
+
isFree: true,
|
|
33
33
|
features: [
|
|
34
34
|
{ key: "seats", name: "Team seats", value: 1, limit: 1, category: "core" },
|
|
35
35
|
{ key: "projects", name: "Projects", value: 3, limit: 3, category: "core" },
|
|
36
36
|
],
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
isActive: true,
|
|
38
|
+
isFeatured: false,
|
|
39
|
+
trialDays: 0,
|
|
40
|
+
sortOrder: 0,
|
|
41
|
+
ctaText: "Start Free",
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
id: "offer-2",
|
|
45
45
|
name: "Pro",
|
|
46
46
|
slug: "pro-monthly",
|
|
47
|
-
|
|
47
|
+
unitPrice: "49.00",
|
|
48
48
|
currency: "USD",
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
pricingModel: "flat",
|
|
50
|
+
intervalUnit: "month",
|
|
51
|
+
intervalCount: 1,
|
|
52
|
+
intervalDisplay: "per month",
|
|
53
|
+
isRecurring: true,
|
|
54
|
+
isFree: false,
|
|
55
55
|
features: [
|
|
56
56
|
{ key: "seats", name: "Team seats", value: 5, limit: 5, category: "core" },
|
|
57
57
|
{ key: "projects", name: "Projects", value: "Unlimited", category: "core" },
|
|
58
58
|
],
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
isActive: true,
|
|
60
|
+
isFeatured: true,
|
|
61
|
+
trialDays: 14,
|
|
62
|
+
sortOrder: 1,
|
|
63
|
+
ctaText: "Start Trial",
|
|
64
64
|
},
|
|
65
65
|
],
|
|
66
66
|
};
|
|
@@ -140,7 +140,7 @@ describe("PricingDetailPage integration", () => {
|
|
|
140
140
|
id: "offer-1",
|
|
141
141
|
slug: "starter-monthly",
|
|
142
142
|
name: "Starter",
|
|
143
|
-
|
|
143
|
+
isFree: true,
|
|
144
144
|
})
|
|
145
145
|
);
|
|
146
146
|
});
|
|
@@ -172,8 +172,8 @@ describe("PricingDetailPage integration", () => {
|
|
|
172
172
|
id: "offer-2",
|
|
173
173
|
slug: "pro-monthly",
|
|
174
174
|
name: "Pro",
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
isFree: false,
|
|
176
|
+
unitPrice: "49.00",
|
|
177
177
|
})
|
|
178
178
|
);
|
|
179
179
|
});
|
|
@@ -26,73 +26,73 @@ const mockProduct: BillingProduct = {
|
|
|
26
26
|
id: "offer-1",
|
|
27
27
|
name: "Starter",
|
|
28
28
|
slug: "starter-monthly",
|
|
29
|
-
|
|
29
|
+
unitPrice: "0.00",
|
|
30
30
|
currency: "USD",
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
pricingModel: "flat",
|
|
32
|
+
intervalUnit: "month",
|
|
33
|
+
intervalCount: 1,
|
|
34
|
+
intervalDisplay: "per month",
|
|
35
|
+
isRecurring: true,
|
|
36
|
+
isFree: true,
|
|
37
37
|
features: [
|
|
38
38
|
{ key: "seats", name: "Team seats", value: 1, limit: 1, category: "core" },
|
|
39
39
|
{ key: "projects", name: "Projects", value: 3, limit: 3, category: "core" },
|
|
40
40
|
{ key: "email_support", name: "Email support", value: true, category: "support" },
|
|
41
41
|
{ key: "priority_support", name: "Priority support", value: false, category: "support" },
|
|
42
42
|
],
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
isActive: true,
|
|
44
|
+
isFeatured: false,
|
|
45
|
+
trialDays: 0,
|
|
46
|
+
sortOrder: 0,
|
|
47
|
+
ctaText: "Start Free",
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
id: "offer-2",
|
|
51
51
|
name: "Pro",
|
|
52
52
|
slug: "pro-monthly",
|
|
53
|
-
|
|
53
|
+
unitPrice: "49.00",
|
|
54
54
|
currency: "USD",
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
pricingModel: "flat",
|
|
56
|
+
intervalUnit: "month",
|
|
57
|
+
intervalCount: 1,
|
|
58
|
+
intervalDisplay: "per month",
|
|
59
|
+
isRecurring: true,
|
|
60
|
+
isFree: false,
|
|
61
61
|
features: [
|
|
62
62
|
{ key: "seats", name: "Team seats", value: 5, limit: 5, category: "core" },
|
|
63
63
|
{ key: "projects", name: "Projects", value: "Unlimited", category: "core" },
|
|
64
64
|
{ key: "email_support", name: "Email support", value: true, category: "support" },
|
|
65
65
|
{ key: "priority_support", name: "Priority support", value: true, category: "support" },
|
|
66
66
|
],
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
isActive: true,
|
|
68
|
+
isFeatured: true,
|
|
69
|
+
trialDays: 14,
|
|
70
|
+
sortOrder: 1,
|
|
71
|
+
ctaText: "Start Trial",
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
id: "offer-3",
|
|
75
75
|
name: "Enterprise",
|
|
76
76
|
slug: "enterprise-monthly",
|
|
77
|
-
|
|
77
|
+
unitPrice: "199.00",
|
|
78
78
|
currency: "USD",
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
pricingModel: "per_seat",
|
|
80
|
+
intervalUnit: "month",
|
|
81
|
+
intervalCount: 1,
|
|
82
|
+
intervalDisplay: "per month",
|
|
83
|
+
isRecurring: true,
|
|
84
|
+
isFree: false,
|
|
85
85
|
features: [
|
|
86
86
|
{ key: "seats", name: "Team seats", value: "Unlimited", category: "core" },
|
|
87
87
|
{ key: "projects", name: "Projects", value: "Unlimited", category: "core" },
|
|
88
88
|
{ key: "email_support", name: "Email support", value: true, category: "support" },
|
|
89
89
|
{ key: "priority_support", name: "Priority support", value: true, category: "support" },
|
|
90
90
|
],
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
isActive: true,
|
|
92
|
+
isFeatured: false,
|
|
93
|
+
trialDays: 0,
|
|
94
|
+
sortOrder: 2,
|
|
95
|
+
ctaText: "Contact Sales",
|
|
96
96
|
},
|
|
97
97
|
],
|
|
98
98
|
};
|
|
@@ -104,7 +104,7 @@ interface DetailCardProps {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
function DetailCard({ offer, onSelect }: DetailCardProps) {
|
|
107
|
-
const isFeatured = offer.
|
|
107
|
+
const isFeatured = offer.isFeatured;
|
|
108
108
|
|
|
109
109
|
return (
|
|
110
110
|
<div
|
|
@@ -126,23 +126,23 @@ function DetailCard({ offer, onSelect }: DetailCardProps) {
|
|
|
126
126
|
<h2 className="text-xl font-bold text-gray-900 mb-4">{offer.name}</h2>
|
|
127
127
|
|
|
128
128
|
<div className="mb-2">
|
|
129
|
-
{offer.
|
|
129
|
+
{offer.isFree ? (
|
|
130
130
|
<span aria-label="Free">
|
|
131
131
|
<span aria-hidden="true" className="text-4xl font-extrabold text-gray-900">Free</span>
|
|
132
132
|
</span>
|
|
133
133
|
) : (
|
|
134
|
-
<span aria-label={`${Math.floor(parseFloat(offer.
|
|
134
|
+
<span aria-label={`${Math.floor(parseFloat(offer.unitPrice) || 0)} dollars ${offer.intervalDisplay}`}>
|
|
135
135
|
<span aria-hidden="true" className="text-4xl font-extrabold text-gray-900">
|
|
136
|
-
${Math.floor(parseFloat(offer.
|
|
136
|
+
${Math.floor(parseFloat(offer.unitPrice) || 0)}
|
|
137
137
|
</span>
|
|
138
|
-
<span aria-hidden="true" className="text-base text-gray-500 ml-1"> {offer.
|
|
138
|
+
<span aria-hidden="true" className="text-base text-gray-500 ml-1"> {offer.intervalDisplay}</span>
|
|
139
139
|
</span>
|
|
140
140
|
)}
|
|
141
141
|
</div>
|
|
142
142
|
|
|
143
|
-
{offer.
|
|
143
|
+
{offer.trialDays > 0 && (
|
|
144
144
|
<span className="inline-block bg-blue-50 text-blue-700 text-sm font-semibold px-3 py-1 rounded-lg mb-5 w-fit">
|
|
145
|
-
{offer.
|
|
145
|
+
{offer.trialDays}-day free trial
|
|
146
146
|
</span>
|
|
147
147
|
)}
|
|
148
148
|
|
|
@@ -174,7 +174,7 @@ function DetailCard({ offer, onSelect }: DetailCardProps) {
|
|
|
174
174
|
}
|
|
175
175
|
`}
|
|
176
176
|
>
|
|
177
|
-
{offer.
|
|
177
|
+
{offer.ctaText}
|
|
178
178
|
</button>
|
|
179
179
|
</div>
|
|
180
180
|
);
|
|
@@ -25,67 +25,67 @@ const mockProduct: BillingProduct = {
|
|
|
25
25
|
id: "offer-1",
|
|
26
26
|
name: "Starter",
|
|
27
27
|
slug: "starter-monthly",
|
|
28
|
-
|
|
28
|
+
unitPrice: "0.00",
|
|
29
29
|
currency: "USD",
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
pricingModel: "flat",
|
|
31
|
+
intervalUnit: "month",
|
|
32
|
+
intervalCount: 1,
|
|
33
|
+
intervalDisplay: "per month",
|
|
34
|
+
isRecurring: true,
|
|
35
|
+
isFree: true,
|
|
36
36
|
features: [
|
|
37
37
|
{ key: "seats", name: "Team seats", value: 1, limit: 1 },
|
|
38
38
|
{ key: "projects", name: "Projects", value: 3, limit: 3 },
|
|
39
39
|
],
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
isActive: true,
|
|
41
|
+
isFeatured: false,
|
|
42
|
+
trialDays: 0,
|
|
43
|
+
sortOrder: 0,
|
|
44
|
+
ctaText: "Start Free",
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
id: "offer-2",
|
|
48
48
|
name: "Pro",
|
|
49
49
|
slug: "pro-monthly",
|
|
50
|
-
|
|
50
|
+
unitPrice: "49.00",
|
|
51
51
|
currency: "USD",
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
pricingModel: "flat",
|
|
53
|
+
intervalUnit: "month",
|
|
54
|
+
intervalCount: 1,
|
|
55
|
+
intervalDisplay: "per month",
|
|
56
|
+
isRecurring: true,
|
|
57
|
+
isFree: false,
|
|
58
58
|
features: [
|
|
59
59
|
{ key: "seats", name: "Team seats", value: 5, limit: 5 },
|
|
60
60
|
{ key: "projects", name: "Projects", value: "Unlimited" },
|
|
61
61
|
],
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
isActive: true,
|
|
63
|
+
isFeatured: true,
|
|
64
|
+
trialDays: 14,
|
|
65
|
+
sortOrder: 1,
|
|
66
|
+
ctaText: "Start Trial",
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
id: "offer-3",
|
|
70
70
|
name: "Enterprise",
|
|
71
71
|
slug: "enterprise-monthly",
|
|
72
|
-
|
|
72
|
+
unitPrice: "199.00",
|
|
73
73
|
currency: "USD",
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
pricingModel: "per_seat",
|
|
75
|
+
intervalUnit: "month",
|
|
76
|
+
intervalCount: 1,
|
|
77
|
+
intervalDisplay: "per month",
|
|
78
|
+
isRecurring: true,
|
|
79
|
+
isFree: false,
|
|
80
80
|
features: [
|
|
81
81
|
{ key: "seats", name: "Team seats", value: "Unlimited" },
|
|
82
82
|
{ key: "projects", name: "Projects", value: "Unlimited" },
|
|
83
83
|
],
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
isActive: true,
|
|
85
|
+
isFeatured: false,
|
|
86
|
+
trialDays: 0,
|
|
87
|
+
sortOrder: 2,
|
|
88
|
+
ctaText: "Contact Sales",
|
|
89
89
|
},
|
|
90
90
|
],
|
|
91
91
|
};
|
|
@@ -77,7 +77,7 @@ interface PricingCardProps {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
function PricingCard({ offer, onSelect }: PricingCardProps) {
|
|
80
|
-
const isFeatured = offer.
|
|
80
|
+
const isFeatured = offer.isFeatured;
|
|
81
81
|
|
|
82
82
|
return (
|
|
83
83
|
<div
|
|
@@ -100,24 +100,24 @@ function PricingCard({ offer, onSelect }: PricingCardProps) {
|
|
|
100
100
|
<h2 className="text-xl font-bold text-gray-900 mb-4">{offer.name}</h2>
|
|
101
101
|
|
|
102
102
|
<div className="mb-2">
|
|
103
|
-
{offer.
|
|
103
|
+
{offer.isFree ? (
|
|
104
104
|
<span className="text-4xl font-extrabold text-gray-900">Free</span>
|
|
105
105
|
) : (
|
|
106
106
|
<span>
|
|
107
107
|
<span className="text-4xl font-extrabold text-gray-900">
|
|
108
|
-
${Math.floor(parseFloat(offer.
|
|
108
|
+
${Math.floor(parseFloat(offer.unitPrice) || 0)}
|
|
109
109
|
</span>
|
|
110
|
-
<span className="text-base text-gray-500 ml-1"> {offer.
|
|
110
|
+
<span className="text-base text-gray-500 ml-1"> {offer.intervalDisplay}</span>
|
|
111
111
|
</span>
|
|
112
112
|
)}
|
|
113
113
|
</div>
|
|
114
114
|
|
|
115
|
-
{offer.
|
|
115
|
+
{offer.trialDays > 0 && (
|
|
116
116
|
<span
|
|
117
117
|
data-testid="trial-badge"
|
|
118
118
|
className="inline-block bg-blue-50 text-blue-700 text-sm font-semibold px-3 py-1 rounded-lg mb-5 w-fit"
|
|
119
119
|
>
|
|
120
|
-
{offer.
|
|
120
|
+
{offer.trialDays}-day free trial
|
|
121
121
|
</span>
|
|
122
122
|
)}
|
|
123
123
|
|
|
@@ -146,7 +146,7 @@ function PricingCard({ offer, onSelect }: PricingCardProps) {
|
|
|
146
146
|
}
|
|
147
147
|
`}
|
|
148
148
|
>
|
|
149
|
-
{offer.
|
|
149
|
+
{offer.ctaText}
|
|
150
150
|
</button>
|
|
151
151
|
</div>
|
|
152
152
|
);
|
|
@@ -25,14 +25,14 @@ const mockProduct: BillingProduct = {
|
|
|
25
25
|
id: "offer-1",
|
|
26
26
|
name: "Starter",
|
|
27
27
|
slug: "starter-monthly",
|
|
28
|
-
|
|
28
|
+
unitPrice: "0.00",
|
|
29
29
|
currency: "USD",
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
pricingModel: "flat",
|
|
31
|
+
intervalUnit: "month",
|
|
32
|
+
intervalCount: 1,
|
|
33
|
+
intervalDisplay: "per month",
|
|
34
|
+
isRecurring: true,
|
|
35
|
+
isFree: true,
|
|
36
36
|
features: [
|
|
37
37
|
{ key: "seats", name: "Team seats", value: 1, limit: 1 },
|
|
38
38
|
{ key: "projects", name: "Projects", value: 3, limit: 3 },
|
|
@@ -40,24 +40,24 @@ const mockProduct: BillingProduct = {
|
|
|
40
40
|
{ key: "support", name: "Support", value: "Email" },
|
|
41
41
|
{ key: "api", name: "API Access", value: "Limited" },
|
|
42
42
|
],
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
isActive: true,
|
|
44
|
+
isFeatured: false,
|
|
45
|
+
trialDays: 0,
|
|
46
|
+
sortOrder: 0,
|
|
47
|
+
ctaText: "Start Free",
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
id: "offer-2",
|
|
51
51
|
name: "Pro",
|
|
52
52
|
slug: "pro-monthly",
|
|
53
|
-
|
|
53
|
+
unitPrice: "49.00",
|
|
54
54
|
currency: "USD",
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
pricingModel: "flat",
|
|
56
|
+
intervalUnit: "month",
|
|
57
|
+
intervalCount: 1,
|
|
58
|
+
intervalDisplay: "per month",
|
|
59
|
+
isRecurring: true,
|
|
60
|
+
isFree: false,
|
|
61
61
|
features: [
|
|
62
62
|
{ key: "seats", name: "Team seats", value: 5, limit: 5 },
|
|
63
63
|
{ key: "projects", name: "Projects", value: "Unlimited" },
|
|
@@ -65,24 +65,24 @@ const mockProduct: BillingProduct = {
|
|
|
65
65
|
{ key: "support", name: "Support", value: "Priority" },
|
|
66
66
|
{ key: "api", name: "API Access", value: "Full" },
|
|
67
67
|
],
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
isActive: true,
|
|
69
|
+
isFeatured: true,
|
|
70
|
+
trialDays: 14,
|
|
71
|
+
sortOrder: 1,
|
|
72
|
+
ctaText: "Start Trial",
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
id: "offer-3",
|
|
76
76
|
name: "Enterprise",
|
|
77
77
|
slug: "enterprise-monthly",
|
|
78
|
-
|
|
78
|
+
unitPrice: "199.00",
|
|
79
79
|
currency: "USD",
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
pricingModel: "per_seat",
|
|
81
|
+
intervalUnit: "month",
|
|
82
|
+
intervalCount: 1,
|
|
83
|
+
intervalDisplay: "per month",
|
|
84
|
+
isRecurring: true,
|
|
85
|
+
isFree: false,
|
|
86
86
|
features: [
|
|
87
87
|
{ key: "seats", name: "Team seats", value: "Unlimited" },
|
|
88
88
|
{ key: "projects", name: "Projects", value: "Unlimited" },
|
|
@@ -91,11 +91,11 @@ const mockProduct: BillingProduct = {
|
|
|
91
91
|
{ key: "api", name: "API Access", value: "Full" },
|
|
92
92
|
{ key: "sla", name: "SLA", value: "99.9%" },
|
|
93
93
|
],
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
isActive: true,
|
|
95
|
+
isFeatured: false,
|
|
96
|
+
trialDays: 0,
|
|
97
|
+
sortOrder: 2,
|
|
98
|
+
ctaText: "Contact Sales",
|
|
99
99
|
},
|
|
100
100
|
],
|
|
101
101
|
};
|
|
@@ -77,7 +77,7 @@ interface SectionCardProps {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
function SectionCard({ offer, onSelect, maxFeatures }: SectionCardProps) {
|
|
80
|
-
const isFeatured = offer.
|
|
80
|
+
const isFeatured = offer.isFeatured;
|
|
81
81
|
const visibleFeatures = offer.features.slice(0, maxFeatures);
|
|
82
82
|
|
|
83
83
|
return (
|
|
@@ -95,24 +95,24 @@ function SectionCard({ offer, onSelect, maxFeatures }: SectionCardProps) {
|
|
|
95
95
|
<h3 className="text-lg font-bold text-gray-900 mb-2">{offer.name}</h3>
|
|
96
96
|
|
|
97
97
|
<div className="mb-2">
|
|
98
|
-
{offer.
|
|
98
|
+
{offer.isFree ? (
|
|
99
99
|
<span className="text-2xl font-extrabold text-gray-900">Free</span>
|
|
100
100
|
) : (
|
|
101
101
|
<span>
|
|
102
102
|
<span className="text-2xl font-extrabold text-gray-900">
|
|
103
|
-
${Math.floor(parseFloat(offer.
|
|
103
|
+
${Math.floor(parseFloat(offer.unitPrice) || 0)}
|
|
104
104
|
</span>
|
|
105
|
-
<span className="text-sm text-gray-500 ml-1"> {offer.
|
|
105
|
+
<span className="text-sm text-gray-500 ml-1"> {offer.intervalDisplay}</span>
|
|
106
106
|
</span>
|
|
107
107
|
)}
|
|
108
108
|
</div>
|
|
109
109
|
|
|
110
|
-
{offer.
|
|
110
|
+
{offer.trialDays > 0 && (
|
|
111
111
|
<span
|
|
112
112
|
data-testid="trial-badge"
|
|
113
113
|
className="inline-block bg-blue-50 text-blue-700 text-xs font-semibold px-2 py-0.5 rounded-md mb-3 w-fit"
|
|
114
114
|
>
|
|
115
|
-
{offer.
|
|
115
|
+
{offer.trialDays}-day free trial
|
|
116
116
|
</span>
|
|
117
117
|
)}
|
|
118
118
|
|
|
@@ -147,7 +147,7 @@ function SectionCard({ offer, onSelect, maxFeatures }: SectionCardProps) {
|
|
|
147
147
|
}
|
|
148
148
|
`}
|
|
149
149
|
>
|
|
150
|
-
{offer.
|
|
150
|
+
{offer.ctaText}
|
|
151
151
|
</button>
|
|
152
152
|
</div>
|
|
153
153
|
);
|