import 'package:flutter/material.dart';


class AddPaymentMethodTile extends StatelessWidget {
  final String label;
  final VoidCallback onTap;

  const AddPaymentMethodTile({
    super.key,
    required this.label,
    required this.onTap,
  });

  static const double _borderRadius = 12;
  static const double _iconSize = 18;
  static const double _minWidth = 150;
  static const EdgeInsets _padding = EdgeInsets.all(12);

  @override
  Widget build(BuildContext context) {
    final theme = Theme.of(context);
    final borderColor = theme.colorScheme.primary.withValues(alpha: 0.45);

    return ConstrainedBox(
      constraints: const BoxConstraints(minWidth: _minWidth),
      child: Material(
        color: theme.colorScheme.onSecondary,
        borderRadius: BorderRadius.circular(_borderRadius),
        child: InkWell(
          onTap: onTap,
          borderRadius: BorderRadius.circular(_borderRadius),
          child: Container(
            padding: _padding,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(_borderRadius),
              border: Border.all(color: borderColor),
            ),
            child: Row(
              children: [
                Icon(Icons.add, size: _iconSize, color: theme.colorScheme.primary),
                const SizedBox(width: 8),
                Expanded(
                  child: Text(
                    label,
                    overflow: TextOverflow.ellipsis,
                    style: theme.textTheme.titleSmall?.copyWith(
                      fontWeight: FontWeight.w600,
                      color: theme.colorScheme.primary,
                    ),
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
