import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import 'package:pshared/provider/payment/wallets.dart';

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


class WalletEditHeader extends StatelessWidget {
  const WalletEditHeader({super.key});

  @override
  Widget build(BuildContext context) {
    final provider = context.watch<WalletsProvider>();
    final wallet = provider.selectedWallet;
    final loc = AppLocalizations.of(context)!;

    if (wallet == null) {
      return const SizedBox.shrink();
    }

    final theme = Theme.of(context);

    return Row(
      spacing: 8,
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Expanded(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            spacing: 4,
            children: [
              Text(
                loc.paymentTypeCryptoWallet,
                style: theme.textTheme.headlineMedium!.copyWith(
                  fontWeight: FontWeight.bold,
                ),
              ),
              if (wallet.tokenSymbol != null)
                Text(
                  wallet.tokenSymbol!,
                  style: theme.textTheme.bodyMedium?.copyWith(
                    color: theme.colorScheme.onSurfaceVariant,
                  ),
                ),
            ],
          ),
        ),
      ],
    );
  }
}
