import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:flutter/material.dart';

class UpSalesBottomButton extends StatelessWidget {
  final List<Widget> children;
  final VoidCallback onContinue;
  final VoidCallback? onSinglePurchaseContinue;
  final int extrasTotalPrice;
  final String selectedRoomUpgrade;
  final bool isSinglePurchase;
  const UpSalesBottomButton({
    super.key,
    required this.onContinue,
    required this.children,
    required this.extrasTotalPrice,
    required this.selectedRoomUpgrade,
    this.onSinglePurchaseContinue,
    this.isSinglePurchase = false,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Theme.of(context).colorScheme.surface,
      child: Padding(
        padding: const EdgeInsets.only(
          left: 16.0,
          right: 16.0,
          top: 16.0,
          bottom: 40,
        ),
        child: ElevatedButton(
          onPressed: () {
            if (isSinglePurchase) {
              onSinglePurchaseContinue!();
            } else {
              onContinue();
            }
          },
          style: ButtonStyle(
            elevation: WidgetStateProperty.all(0),
            backgroundColor: WidgetStateProperty.all(sandColor),
            foregroundColor: const WidgetStatePropertyAll(Colors.white),
          ),
          child: Padding(
              padding: const EdgeInsets.symmetric(vertical: 16.0),
              child: Row(
                mainAxisAlignment: children.length > 1
                    ? MainAxisAlignment.spaceBetween
                    : MainAxisAlignment.center,
                children: children,
              )),
        ),
      ),
    );
  }
}