import 'package:flutter/material.dart';

import 'package:pweb/generated/i18n/app_localizations.dart';


class BalanceAddFunds extends StatelessWidget {
  final VoidCallback onTopUp;

  const BalanceAddFunds({
    super.key,
    required this.onTopUp,
  });

  static const double _borderRadius = 5.0;
  static const double _iconSize = 24.0;
  static const double _paddingVertical = 2.0;
  static const double _spacingSmall = 3.0;
  static const double _spacingMedium = 5.0;

  @override
  Widget build(BuildContext context) {
    final textTheme = Theme.of(context).textTheme;
    final colorScheme = Theme.of(context).colorScheme;
    final loc = AppLocalizations.of(context)!;

    return InkWell(
      onTap: onTopUp,
      borderRadius: BorderRadius.circular(_borderRadius),
      hoverColor: colorScheme.primaryContainer,
      child: Padding(
        padding: const EdgeInsets.symmetric(vertical: _paddingVertical),
        child: Row(
          mainAxisSize: MainAxisSize.min,
          children: [
            const SizedBox(width: _spacingSmall),
            Icon(
              Icons.add_circle,
              color: colorScheme.primary,
              size: _iconSize,
            ),
            const SizedBox(width: _spacingMedium),
            Text(
              loc.addFunds,
              style: textTheme.bodyMedium?.copyWith(
                color: colorScheme.primary,
                fontWeight: FontWeight.w500,
              ),
            ),
            const SizedBox(width: _spacingSmall),
          ],
        ),
      ),
    );
  }
}
