import 'package:flutter/material.dart';

import '../../../themes/styles_text.dart';

class SecondButton extends StatelessWidget {
  final IconData? leftIcon;
  final Function onPressed;
  final String title;
  final Color? color;
  final Color? textColor;
  final Color? borderColor;
  final double? width;
  final double? height;
  const SecondButton({
    super.key,
    required this.onPressed,
    this.leftIcon,
    required this.title,
    this.color,
    this.textColor,
    this.borderColor,
    this.width,
    this.height,
  });

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        onPressed();
      },
      child: Container(
        width: width,
        height: height,
        padding: EdgeInsets.all(7),
        margin: EdgeInsets.symmetric(horizontal: 8),
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(10),
          border: Border.all(
            color: borderColor ?? Colors.white,
            width: 2,
          ),
          color: color ?? Colors.white,
        ),
        child: Row(
          mainAxisSize: MainAxisSize.min,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            leftIcon != null
                ? Icon(
                    leftIcon,
                    size: 16,
                    color: textColor ?? Colors.grey.shade500,
                  )
                : const SizedBox.shrink(),
            const SizedBox(
              width: 4,
            ),
            Text(
              title,
              // style: StylesText.body5.copyWith(color: textColor ?? Colors.white),
              style: TextStyle(
                color: textColor ?? Colors.white,
                fontSize: 14,
                fontWeight: FontWeight.w500,
              ),
            ),
          ],
        ),
      ),
    );
  }
}
