const { connect } = require('preact-redux'); const preact = require('preact'); const { Elements, injectStripe } = require('react-stripe-elements'); const { saw } = require('./shapes'); function pingColour(ping) { if (ping < 100) return 'forestgreen'; if (ping < 200) return 'yellow'; return 'red'; } function BitsBtn(args) { const { stripe, account, } = args; function subscribeClick(e) { stripe.redirectToCheckout({ items: [{plan: 'plan_FGmRwawcOJJ7Nv', quantity: 1}], successUrl: 'http://localhost:40080/payments/success', cancelUrl: 'http://localhost:40080/payments/cancel', clientReferenceId: account.id }); } function bitsClick(e) { stripe.redirectToCheckout({ items: [{sku: 'sku_FHUfNEhWQaVDaT', quantity: 1}], successUrl: 'http://localhost:40080/payments/success', cancelUrl: 'http://localhost:40080/payments/cancel', clientReferenceId: account.id }); } const subscription = account.subscribed ?