@@ -5,20 +5,28 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
55import Image from "next/image"
66import Link from "next/link"
77import { PiCheck } from "react-icons/pi"
8- import { checkEE } from ". ./actions"
8+ import { getPricingInfo } from "./actions"
99import { useEffect , useState } from "react"
1010
1111export 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