import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_web/utils/color_manager.dart';

class SvgTextButton extends StatelessWidget {
  final String svgAsset;
  final String label;
  final VoidCallback onPressed;
  final Color backgroundColor;
  final Color svgColor;
  final Color labelColor;
  final double borderRadius;
  final List<BoxShadow> boxShadow;
  final double svgSize;
  final double? fontSize;
  final FontWeight? fontWeight;
  const SvgTextButton({
    super.key,
    required this.svgAsset,
    this.fontSize,
    this.fontWeight,
    required this.label,
    required this.onPressed,
    this.backgroundColor = ColorsManager.circleRolesBackground,
    this.svgColor = const Color(0xFF496EFF),
    this.labelColor = Colors.black87,
    this.borderRadius = 10.0,
    this.boxShadow = const [
      BoxShadow(
        color: ColorsManager.textGray,
        blurRadius: 12,
        offset: Offset(0, 4),
      ),
    ],
    this.svgSize = 24.0,
  });

  @override
  Widget build(BuildContext context) {
    return Material(
      color: Colors.transparent,
      child: InkWell(
        borderRadius: BorderRadius.circular(borderRadius),
        onTap: onPressed,
        child: Container(
          padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
          decoration: BoxDecoration(
            color: backgroundColor,
            borderRadius: BorderRadius.circular(borderRadius),
            boxShadow: boxShadow,
          ),
          child: Row(
            mainAxisSize: MainAxisSize.min,
            children: [
              SvgPicture.asset(
                svgAsset,
                width: svgSize,
                height: svgSize,
                color: svgColor,
              ),
              const SizedBox(width: 12),
              Text(
                label,
                style: TextStyle(
                  color: labelColor,
                  fontSize: fontSize ?? 16,
                  fontWeight: fontWeight ?? FontWeight.w500,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
