import 'package:flutter/material.dart';

import 'package:pweb/pages/wallet_top_up/address_block.dart';
import 'package:pweb/utils/dimensions.dart';

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


class WalletTopUpDetails extends StatelessWidget {
  final String? address;
  final AppDimensions dimensions;

  const WalletTopUpDetails({
    super.key,
    required this.address,
    required this.dimensions,
  });

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

    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Text(
          loc.walletTopUpDetailsTitle,
          style: theme.textTheme.titleMedium,
        ),
        const SizedBox(height: 6),
        Text(
          loc.walletTopUpDescription,
          style: theme.textTheme.bodyMedium?.copyWith(
            color: theme.colorScheme.onSurfaceVariant,
          ),
        ),
        SizedBox(height: dimensions.paddingLarge),
        if (address == null || address!.isEmpty)
          Text(
            loc.walletTopUpUnavailable,
            style: theme.textTheme.bodyMedium,
          )
        else ...[
          WalletTopUpAddressBlock(
            address: address!,
            dimensions: dimensions,
          ),
          SizedBox(height: dimensions.paddingLarge),
          Text(
            loc.walletTopUpHint,
            style: theme.textTheme.bodySmall?.copyWith(
              color: theme.colorScheme.onSurfaceVariant,
            ),
          ),
        ],
      ],
    );
  }
}
