import 'package:flutter/material.dart';

import '../theme/app_colors.dart';

class ControlButton extends StatelessWidget {
  const ControlButton({
    required this.label,
    required this.icon,
    required this.onPressed,
    this.isFilled = true,
    super.key,
  });

  final String label;
  final IconData icon;
  final VoidCallback? onPressed;
  final bool isFilled;

  @override
  Widget build(BuildContext context) {
    if (isFilled) {
      return DecoratedBox(
        decoration: BoxDecoration(
          gradient: AppColors.primaryGradient,
          borderRadius: BorderRadius.circular(AppRadius.medium),
        ),
        child: FilledButton.icon(
          style: FilledButton.styleFrom(
            backgroundColor: Colors.transparent,
            shadowColor: Colors.transparent,
            minimumSize: const Size.fromHeight(48),
          ),
           onPressed: onPressed,
          icon: Icon(icon),
          label: Text(label),
        ),
      );
    }

    return OutlinedButton.icon(
       onPressed: onPressed,
      icon: Icon(icon),
      label: Text(label),
    );
  }
}
