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

class CustomAddButton extends StatelessWidget {
  final Widget icon;
  final String text;
  final Color bgColor;
  final bool needsBorder;
  final Function() onTap;

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

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: Container(
        height: 80,
        decoration: BoxDecoration(color: bgColor, border: needsBorder ? Border.all(width: 2, color: MyColors.darkPrimaryColor) : null),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            icon,
            const SizedBox(width: 10),
            text.toText(
              fontSize: 15,
              color: MyColors.lightTextColor,
            ),
          ],
        ),
      ),
    );
  }
}
