import 'package:flutter/material.dart';

class SecondaryButton extends StatelessWidget {
  final VoidCallback onPressed;
  final String? text;
  final IconData? icon;
  final String? label;
  final Color? color;
  final double radius;
  final double padding;
  final double height;
  final double? width;
  final double? size;

  const SecondaryButton({
    super.key,
    required this.onPressed,
    this.text,
    this.icon,
    this.label,
    this.color,
    this.radius = 18,
    this.padding = 0,
    this.height = 60,
    this.width,
    this.size,
  });

  @override
  Widget build(BuildContext context) {
    return OutlinedButton(
      style: ButtonStyle(
        padding: WidgetStatePropertyAll(
          EdgeInsets.symmetric(horizontal: padding),
        ),
        shape: WidgetStatePropertyAll(
          RoundedRectangleBorder(
            borderRadius: BorderRadius.all(Radius.circular(radius)),
            side: BorderSide(color: Color(0xFF4B4B4B)),
          ),
        ),
      ),
      onPressed: onPressed,
      child: SizedBox(
        width: width,
        height: height,
        child: Center(
          child: text != null
              ? Text(
                  text!,
                  textAlign: TextAlign.center,
                  semanticsLabel: label,
                  style: TextStyle(
                    fontSize: size ?? 18,
                    fontWeight: FontWeight.w500,
                    letterSpacing: 0,
                    color: Color(0xFF4B4B4B),
                  ),
                )
              : Icon(
                  icon,
                  semanticLabel: label,
                  size: size ?? 24,
                  color: color ?? Color(0xFF4B4B4B),
                ),
        ),
      ),
    );
  }
}
