
import 'package:flutter/material.dart';
import 'package:responsive_builder/responsive_builder.dart';

import '../models/order.dart';
import '../models/payment_platform.dart';
import '../models/stripe_payment_method.dart';
import '../store/actions.dart';
import '../store/store.dart';
import '../widgets/desktop/desktop_stripe_pay_web.dart';
import '../widgets/mobile/mobile_stripe_pay_web.dart';

class StripePayWeb extends StatelessWidget {
  final Order order;
  final PaymentPlatform paymentPlatform;
  final StripePaymentMethod? stripePaymentMethod;

  const StripePayWeb(this.order, this.paymentPlatform, {this.stripePaymentMethod});

  @override
  Widget build(BuildContext context) {
    store.dispatch(UpdateContext(context));

    return ResponsiveBuilder(
      builder: (context, sizingInformation) =>
          ScreenTypeLayout.builder(
            mobile: (context) => MobileStripePayWeb(order, paymentPlatform, stripePaymentMethod: stripePaymentMethod,),
            tablet: (context) => DesktopStripePayWeb(order, paymentPlatform, stripePaymentMethod: stripePaymentMethod,),
            desktop: (context) => DesktopStripePayWeb(order, paymentPlatform, stripePaymentMethod: stripePaymentMethod,),
          ),
    );
  }

}