import 'package:flutter/material.dart';


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

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

  static const double _avatarRadius = 20;
  static const double _tileSize = 80;
  static const double _verticalSpacing = 6;

  @override
  Widget build(BuildContext context) {
    final theme = Theme.of(context);
    final buttonBorderColor = theme.colorScheme.primary;
    final buttonBackgroundColor = theme.colorScheme.onSecondary;
    final buttonIconColor = theme.colorScheme.primary;

    return InkWell(
      onTap: onTap,
      borderRadius: BorderRadius.circular(8),
      hoverColor: theme.colorScheme.surfaceContainerHighest,
      child: SizedBox(
        width: _tileSize,
        height: _tileSize,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Container(
              width: _avatarRadius * 2,
              height: _avatarRadius * 2,
              alignment: Alignment.center,
              decoration: BoxDecoration(
                color: buttonBackgroundColor,
                shape: BoxShape.circle,
                border: Border.fromBorderSide(
                  BorderSide(color: buttonBorderColor, width: 1.5),
                ),
              ),
              child: Icon(
                Icons.add,
                color: buttonIconColor,
                size: 20,
              ),
            ),
            const SizedBox(height: _verticalSpacing),
            Text(
              label,
              maxLines: 2,
              overflow: TextOverflow.ellipsis,
              textAlign: TextAlign.center,
              style: theme.textTheme.bodySmall?.copyWith(fontSize: 12),
            ),
          ],
        ),
      ),
    );
  }
}
