import 'package:flutter/material.dart';
import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/theme/colors.dart';
import 'package:mc_common_app/widgets/common_widgets/dotted_rect.dart';

class DottedRoundedCard extends StatelessWidget {
  final Function() onTap;
  final String text;
  final Widget icon;

  const DottedRoundedCard({Key? key, required this.onTap, required this.text, required this.icon}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: Container(
        height: 120,
        width: 120,
        color: MyColors.white,
        child: DashedRect(
          color: MyColors.lightIconColor,
          strokeWidth: 2.0,
          gap: 4.0,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              icon,
              SizedBox(width: 8),
              text.toText(
                fontSize: 15,
                isBold: true,
                color: MyColors.darkPrimaryColor,
              ),
            ],
          ),
        ),
      ),
    );
  }
}

class DottedRectContainer extends StatelessWidget {
  final Function() onTap;
  final String text;
  final Widget icon;

  const DottedRectContainer({Key? key, required this.onTap, required this.text, required this.icon}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: Container(
        height: 46,
        width: double.infinity,
        color: MyColors.white,
        child: DashedRect(
          color: MyColors.lightIconColor,
          strokeWidth: 2.0,
          gap: 4.0,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              icon,
              SizedBox(width: 8),
              text.toText(
                fontSize: 15,
                isBold: true,
                color: MyColors.darkPrimaryColor,
              ),
            ],
          ),
        ),
      ),
    );
  }
}
//
// class BuildAdStepContainer extends StatelessWidget {
//   final WidgetBuilder onVehicleDetails;
//   final WidgetBuilder onDamageParts;
//   final WidgetBuilder onAdDuration;
//   final WidgetBuilder onReviewAd;
//   final AdCreationStepsEnum adCreationStepsEnum;
//
//   const BuildAdStepContainer({
//     Key? key,
//     required this.onVehicleDetails,
//     required this.onDamageParts,
//     required this.onAdDuration,
//     required this.onReviewAd,
//     required this.adCreationStepsEnum,
//   }) : super(key: key);
//
//   @override
//   Widget build(BuildContext context) {
//     switch (adCreationStepsEnum) {
//       case AdCreationStepsEnum.vehicleDetails:
//         return onVehicleDetails(context);
//
//       case AdCreationStepsEnum.damageParts:
//         return onDamageParts(context);
//
//       case AdCreationStepsEnum.adDuration:
//         return onAdDuration(context);
//
//       case AdCreationStepsEnum.reviewAd:
//         return onReviewAd(context);
//     }
//   }
// }
