@wopr-network/platform-ui-core 1.27.4 → 1.27.6
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
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { Check } from "lucide-react";
|
|
2
2
|
import Link from "next/link";
|
|
3
|
-
import {
|
|
3
|
+
import { BuyCreditsPanel } from "@/components/billing/buy-credits-panel";
|
|
4
|
+
import { CryptoCheckout } from "@/components/billing/crypto-checkout";
|
|
4
5
|
import { Button } from "@/components/ui/button";
|
|
5
6
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
6
|
-
import { productName } from "@/lib/brand-config";
|
|
7
|
+
import { getBrandConfig, productName } from "@/lib/brand-config";
|
|
7
8
|
import { pricingData } from "@/lib/pricing-data";
|
|
8
9
|
|
|
9
10
|
export default function PlansPage() {
|
|
11
|
+
const { planFeatures } = getBrandConfig();
|
|
10
12
|
return (
|
|
11
13
|
<div className="max-w-3xl space-y-6">
|
|
12
14
|
<div>
|
|
@@ -14,8 +16,6 @@ export default function PlansPage() {
|
|
|
14
16
|
<p className="text-sm text-muted-foreground">Simple pricing. No tiers. No gotchas.</p>
|
|
15
17
|
</div>
|
|
16
18
|
|
|
17
|
-
<ByokCallout />
|
|
18
|
-
|
|
19
19
|
<Card className="border-terminal shadow-[0_0_12px_rgba(0,255,65,0.15)]">
|
|
20
20
|
<CardHeader className="text-center">
|
|
21
21
|
<CardTitle className="text-sm uppercase tracking-widest text-muted-foreground">
|
|
@@ -31,12 +31,7 @@ export default function PlansPage() {
|
|
|
31
31
|
</p>
|
|
32
32
|
<p className="text-muted-foreground">per bot</p>
|
|
33
33
|
<ul className="space-y-2 text-sm">
|
|
34
|
-
{
|
|
35
|
-
`$${pricingData.signup_credit} signup credit included`,
|
|
36
|
-
"All channels",
|
|
37
|
-
"All plugins",
|
|
38
|
-
"All providers",
|
|
39
|
-
].map((feature) => (
|
|
34
|
+
{planFeatures.map((feature) => (
|
|
40
35
|
<li key={feature} className="flex items-center gap-2 text-muted-foreground">
|
|
41
36
|
<Check className="size-4 shrink-0 text-terminal" />
|
|
42
37
|
{feature}
|
|
@@ -52,7 +47,8 @@ export default function PlansPage() {
|
|
|
52
47
|
</CardContent>
|
|
53
48
|
</Card>
|
|
54
49
|
|
|
55
|
-
<
|
|
50
|
+
<BuyCreditsPanel />
|
|
51
|
+
<CryptoCheckout />
|
|
56
52
|
</div>
|
|
57
53
|
);
|
|
58
54
|
}
|
package/src/lib/brand-config.ts
CHANGED
|
@@ -93,6 +93,9 @@ export interface BrandConfig {
|
|
|
93
93
|
|
|
94
94
|
/** Whether the embedded chat widget is enabled (default true). */
|
|
95
95
|
chatEnabled: boolean;
|
|
96
|
+
|
|
97
|
+
/** Feature bullet points shown on the billing plans page. */
|
|
98
|
+
planFeatures: string[];
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
/**
|
|
@@ -129,6 +132,20 @@ function parseNavItems(raw: string | undefined): Array<{ label: string; href: st
|
|
|
129
132
|
return null;
|
|
130
133
|
}
|
|
131
134
|
|
|
135
|
+
/** Parse a JSON string array env var. Returns null if unset/invalid. */
|
|
136
|
+
function parseStringArray(raw: string | undefined): string[] | null {
|
|
137
|
+
if (!raw) return null;
|
|
138
|
+
try {
|
|
139
|
+
const parsed = JSON.parse(raw);
|
|
140
|
+
if (Array.isArray(parsed) && parsed.every((s: unknown) => typeof s === "string")) {
|
|
141
|
+
return parsed as string[];
|
|
142
|
+
}
|
|
143
|
+
} catch {
|
|
144
|
+
// Invalid JSON — fall back to defaults
|
|
145
|
+
}
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
|
|
132
149
|
function envDefaults(): BrandConfig {
|
|
133
150
|
// Direct process.env.X access is required — Next.js Turbopack only inlines
|
|
134
151
|
// NEXT_PUBLIC_* vars when accessed as literal dot-property references.
|
|
@@ -158,6 +175,12 @@ function envDefaults(): BrandConfig {
|
|
|
158
175
|
price: process.env.NEXT_PUBLIC_BRAND_PRICE || "",
|
|
159
176
|
homePath: process.env.NEXT_PUBLIC_BRAND_HOME_PATH || "/marketplace",
|
|
160
177
|
chatEnabled: process.env.NEXT_PUBLIC_BRAND_CHAT_ENABLED !== "false",
|
|
178
|
+
planFeatures: parseStringArray(process.env.NEXT_PUBLIC_BRAND_PLAN_FEATURES) ?? [
|
|
179
|
+
"Signup credit included",
|
|
180
|
+
"All channels",
|
|
181
|
+
"All plugins",
|
|
182
|
+
"Hosted AI — no API keys needed",
|
|
183
|
+
],
|
|
161
184
|
navItems: parseNavItems(process.env.NEXT_PUBLIC_BRAND_NAV_ITEMS) ?? [
|
|
162
185
|
{ label: "Dashboard", href: "/dashboard" },
|
|
163
186
|
{ label: "Chat", href: "/chat" },
|