Purchase Plan Button

A button component to purchase a subscription plan.

Comes with a server action that will create a Stripe Checkout instance for the corresponding price ID.

Usage

import { PurchasePlanButton } from "@/app/_components/core/purchase-plan-button/_components/purchase-plan-button";
<PurchasePlanButton planName={PlanName.BASIC}>Purchase Plan</PurchasePlanButton>

Props

NameTypeDefaultDescription
childrenReactNodeThe content to be displayed in the button.
classNamestringAdditional classes.
planNamePlanNameThe name of the plan to be purchased. The PlanName enum is defined in your Prisma schema