20 lines
458 B
TypeScript
20 lines
458 B
TypeScript
|
|
"use client";
|
||
|
|
|
||
|
|
import { loadStripe } from '@stripe/stripe-js';
|
||
|
|
import { Elements } from '@stripe/react-stripe-js';
|
||
|
|
import { ReactNode } from 'react';
|
||
|
|
|
||
|
|
const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!);
|
||
|
|
|
||
|
|
interface StripeProviderProps {
|
||
|
|
children: ReactNode;
|
||
|
|
}
|
||
|
|
|
||
|
|
export default function StripeProvider({ children }: StripeProviderProps) {
|
||
|
|
return (
|
||
|
|
<Elements stripe={stripePromise}>
|
||
|
|
{children}
|
||
|
|
</Elements>
|
||
|
|
);
|
||
|
|
}
|