Skip to content

Commit

Permalink
Update page.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ArhanAnsari authored Sep 30, 2024
1 parent 98bb2d5 commit 3d276a8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/plans/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import getStripe from "@/lib/stripe-js";
import React from "react";
import SEO from "@/components/SEO"; // Import the SEO component

// Define the type for userPlan prop and make it optional
interface PlansPageProps {
userPlan?: string; // Optional prop
}
// Simplified, without explicit interface export for props
export default function PlansPage({ userPlan }: { userPlan?: string }) {
const currentPlan = userPlan || "free"; // Default to "free" if userPlan is not provided

export default function PlansPage({ userPlan = "free" }: PlansPageProps) { // Default to "free" if not provided
const getPriceFn = (plan: string) => {
fetch("/api/checkout?plan=" + plan)
.then((data) => data.json())
Expand All @@ -19,7 +17,7 @@ export default function PlansPage({ userPlan = "free" }: PlansPageProps) { // De
});
};

const isCurrentPlan = (plan: string) => userPlan === plan; // Helper function to check if the plan is active
const isCurrentPlan = (plan: string) => currentPlan === plan; // Helper function to check current plan

return (
<div className="min-h-screen bg-gray-50 py-10 px-4">
Expand Down

0 comments on commit 3d276a8

Please sign in to comment.