import 'package:flutter/material.dart';

import 'package:pweb/models/currency.dart';


String currencyCodeToSymbol(Currency currencyCode) {
  switch (currencyCode) {
    case Currency.usd:
      return '\$';
    case Currency.eur:
      return '€';
    case Currency.rub:
      return '₽';
    case Currency.usdt:
      return 'USDT';
    case Currency.usdc:
      return 'USDC';
  }
}

String currencyToString(Currency currencyCode, double amount) {
  return '${amount.toStringAsFixed(2)} ${currencyCodeToSymbol(currencyCode)}';
}

IconData iconForCurrencyType(Currency currencyCode) {
  switch (currencyCode) {
    case Currency.usd:
      return Icons.currency_exchange;
    case Currency.eur:
      return Icons.currency_exchange;
    case Currency.rub:
      return Icons.currency_ruble;
    case Currency.usdt:
      return Icons.currency_exchange;
    case Currency.usdc:
      return Icons.money;
  }
}