24 lines
666 B
TypeScript
24 lines
666 B
TypeScript
"use client";
|
|
|
|
import {Elements} from "@stripe/react-stripe-js";
|
|
import {loadStripe} from "@stripe/stripe-js";
|
|
|
|
const stripePromise = loadStripe(process.env.STRIPE_KEY || "");
|
|
|
|
export default function PricingTable() {
|
|
return (
|
|
<Elements stripe={stripePromise}>
|
|
<stripe-pricing-table id="pricing" pricing-table-id={process.env.STRIPE_PRICING_TABLE} publishable-key={process.env.STRIPE_KEY} />
|
|
</Elements>
|
|
);
|
|
}
|
|
|
|
// If using TypeScript, add the following snippet to your file as well.
|
|
declare global {
|
|
namespace JSX {
|
|
interface IntrinsicElements {
|
|
"stripe-pricing-table": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
}
|
|
}
|
|
}
|