Skip to content

Commit c58f133

Browse files
Merge pull request #34 from harishdeivanayagam/feature/cloud-alpha-reqs
fix: ee empty pricing credits
2 parents 836c64f + 0cf6be1 commit c58f133

File tree

5 files changed

+37
-19
lines changed

5 files changed

+37
-19
lines changed

src/app/ee/actions.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/app/ee/legal/[slug]/actions.ts

Whitespace-only changes.

src/app/ee/legal/[slug]/page.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import axios from "axios"
22
import Image from "next/image"
3-
import { checkEE } from "../../actions"
43

54
export default async function LegalPage({ params }: { params: Promise<{ slug: string }> }) {
65
const { slug } = await params
76
let legalPageContent = ""
87

9-
const eeEnabled = await checkEE()
10-
11-
if (!eeEnabled) {
8+
if (!process.env.EE_ENABLED || process.env.EE_ENABLED === "false") {
129
return (
1310
<div className="flex flex-col gap-5 items-center justify-center h-screen">
1411
<Image src="/logo.svg" alt="404" width={50} height={50} />

src/app/ee/pricing/actions.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"use server"
2+
3+
export async function getPricingInfo() {
4+
if (!process.env.EE_ENABLED || process.env.EE_ENABLED === "false") {
5+
return {
6+
ee: false,
7+
pricing: {
8+
monthly: "",
9+
yearly: "",
10+
credits: ""
11+
}
12+
}
13+
}
14+
return {
15+
ee: true,
16+
pricing: {
17+
monthly: process.env.PRO_PLAN_PRICE_MONTHLY || "",
18+
yearly: process.env.PRO_PLAN_PRICE_YEARLY || "",
19+
credits: process.env.PRO_PLAN_CREDITS || ""
20+
}
21+
}
22+
}

src/app/ee/pricing/page.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,28 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
55
import Image from "next/image"
66
import Link from "next/link"
77
import { PiCheck } from "react-icons/pi"
8-
import { checkEE } from "../actions"
8+
import { getPricingInfo } from "./actions"
99
import { useEffect, useState } from "react"
1010

1111
export default function PricingPage() {
1212

13-
const [eeEnabled, setEeEnabled] = useState(false)
13+
const [pricingInfo, setPricingInfo] = useState({
14+
ee: false,
15+
pricing: {
16+
monthly: "",
17+
yearly: "",
18+
credits: ""
19+
}
20+
})
1421

1522
useEffect(() => {
1623
(async () => {
17-
setEeEnabled(await checkEE())
24+
const pricingInfo = await getPricingInfo()
25+
setPricingInfo(pricingInfo)
1826
})()
1927
}, [])
2028

21-
if (!eeEnabled) {
29+
if (!pricingInfo.ee) {
2230
return (
2331
<div className="flex flex-col gap-5 items-center justify-center h-screen">
2432
<Image src="/logo.svg" alt="404" width={50} height={50} />
@@ -33,11 +41,11 @@ export default function PricingPage() {
3341
<CardHeader className="flex flex-col items-center">
3442
<Image src="/logo.svg" alt="Rowfill Logo" width={50} height={50} />
3543
<CardTitle className="text-lg pt-2">Professional Plan</CardTitle>
36-
<p className="text-lg font-bold">Starts at ${process.env.PRO_PLAN_PRICE_MONTHLY}/month</p>
44+
<p className="text-lg font-bold">Starts at ${pricingInfo.pricing.monthly}/month</p>
3745
<Button>Get Started</Button>
3846
</CardHeader>
3947
<CardContent className="flex flex-col gap-2 px-5">
40-
<p className="flex items-center gap-2"><PiCheck /> {process.env.PRO_PLAN_CREDITS} Credits</p>
48+
<p className="flex items-center gap-2"><PiCheck /> {pricingInfo.pricing.credits} Credits</p>
4149
<p className="flex items-center gap-2"><PiCheck /> Unlimited Sheets</p>
4250
<p className="flex items-center gap-2"><PiCheck /> Unlimited Sources</p>
4351
<p className="flex items-center gap-2"><PiCheck /> AI Answering Agent</p>

0 commit comments

Comments
 (0)