import 'package:boilerplate/core/i18n/translations.g.dart';
import 'package:boilerplate/core/styles/my_dimensions.dart';
import 'package:boilerplate/core/styles/my_font.dart';
import 'package:flutter/material.dart';

class IPMButton extends StatelessWidget {
  final VoidCallback? onPressed;
  final String? text;
  final Color? textColor;
  final Color? backgroundColor;
  final Color? borderColor;

  const IPMButton({
    Key? key,
    this.onPressed,
    this.text,
    this.textColor,
    this.backgroundColor,
    this.borderColor,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: double.infinity,
      child: ElevatedButton(
        onPressed: this.onPressed,
        child: Text(
          this.text ?? AppLocalizations.global.ok,
          style: MyFont.regular18.copyWith(
            color: this.textColor ?? Colors.white,
          ),
        ),
        style: ElevatedButton.styleFrom(
          padding: EdgeInsets.symmetric(
            vertical: MyDimens.dimen10,
            horizontal: MyDimens.dimen14,
          ),
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(50),
          ),
          primary: this.backgroundColor ?? Color(0xFFB21F29),
          side: BorderSide(
            color: this.borderColor ?? Colors.transparent,
          ),
        ),
      ),
    );
  }
}
