import 'package:flutter/material.dart';

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


class WalletTopUpHeader extends StatelessWidget {
  final VoidCallback onBack;
  final String? tokenSymbol;

  const WalletTopUpHeader({
    super.key,
    required this.onBack,
    this.tokenSymbol,
  });

  @override
  Widget build(BuildContext context) {
    final theme = Theme.of(context);
    final loc = AppLocalizations.of(context)!;
    final symbol = tokenSymbol?.trim();

    final subtitle = [
      loc.paymentTypeCryptoWallet,
      if (symbol != null && symbol.isNotEmpty) symbol,
    ].join(' · ');

    return Row(
      children: [
        IconButton(
          icon: const Icon(Icons.arrow_back),
          onPressed: onBack,
        ),
        const SizedBox(width: 8),
        Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text(
              loc.walletTopUpTitle,
              style: theme.textTheme.titleLarge,
            ),
            const SizedBox(height: 4),
            Text(
              subtitle,
              style: theme.textTheme.bodyMedium?.copyWith(
                color: theme.colorScheme.onSurfaceVariant,
              ),
            ),
          ],
        ),
      ],
    );
  }
}
