import 'package:flutter/widgets.dart';

import 'package:pshared/models/payment/chain_network.dart';

import 'package:pshared/generated/i18n/ps_localizations.dart';


/// Localized labels for [ChainNetwork] values.
extension ChainNetworkL10n on ChainNetwork {
  /// Returns a human-readable, localized name for the chain.
  String localizedName(BuildContext context) {
    final l10n = PSLocalizations.of(context)!;
    switch (this) {
      case ChainNetwork.ethereumMainnet:
        return l10n.chainNetworkEthereumMainnet;
      case ChainNetwork.arbitrumOne:
        return l10n.chainNetworkArbitrumOne;
      case ChainNetwork.arbitrumSepolia:
        return l10n.chainNetworkArbitrumSepolia;
      case ChainNetwork.tronMainnet:
        return l10n.chainNetworkTronMainnet;
      case ChainNetwork.tronNile:
        return l10n.chainNetworkTronNile;
      case ChainNetwork.unspecified:
        return l10n.chainNetworkUnspecified;
    }
  }
}
