import React, { ReactElement } from 'react';
import { StripeProvider } from '@stripe/stripe-react-native';

interface LiteAPIPaymentProps {
  children: ReactElement | ReactElement[];
  sandbox?: boolean;
}

const LiteAPIPayment: React.FC<LiteAPIPaymentProps> = ({ children, sandbox = false }) => {
  const STRIPE_PUBLISHABLE_KEY = sandbox
    ? 'pk_test_51OyYnVA4FXPoRk9YJECd2jJmfprI2inRzqbt5Brk7R41kKIaftBnO8rCetwEVUdfR5WSsLorvNQ0tr4dDcFk8pof002p27EYzN'  
    : 'pk_live_51OyYnVA4FXPoRk9YKY2X48OOO0Dr8mjk4LngAtzHnb8vOoN6sbCY1MKPlqkqcHEK0hzkR7v2tQtveNapXcBBGEkh00qZt4s1FA'  ;

  return (
    <StripeProvider publishableKey={STRIPE_PUBLISHABLE_KEY}>
      {children}
    </StripeProvider>
  );
};

export default LiteAPIPayment;