import { Stripe, loadStripe } from '@stripe/stripe-js'; let stripePromise: Promise; export default function getStripe(): Promise { if (!stripePromise) stripePromise = loadStripe( process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY as string, ); return stripePromise; }