import { loadStripe, Stripe as StripeClient } from '@stripe/stripe-js' // Initialize Stripe on the client side let stripePromise: Promise export const getStripe = () => { if (!stripePromise) { stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!) } return stripePromise } // Donation amount presets (in USD) export const DONATION_PRESETS = [ { amount: 5, label: '$5' }, { amount: 10, label: '$10' }, { amount: 25, label: '$25' }, { amount: 50, label: '$50' }, { amount: 100, label: '$100' }, { amount: 250, label: '$250' }, ] // Helper function to format amount in cents to dollars export const formatAmount = (amountInCents: number, currency: string = 'usd'): string => { const formatter = new Intl.NumberFormat('en-US', { style: 'currency', currency: currency.toUpperCase(), minimumFractionDigits: 2, }) return formatter.format(amountInCents / 100) } // Helper function to convert dollars to cents export const dollarsToCents = (dollars: number): number => { return Math.round(dollars * 100) }