import Vue from 'vue'

// Use i18n translator if installed
const translator =
  (Vue.i18n && Vue.i18n.translate) ||
  function(text) {
    return text
  }

export const Icons = [
  { icon: 'eshop-review', title: translator('Eshop.Order.Review.Text'), name: 'review', order: 1 },
  { icon: 'eshop-payment', title: translator('Common.MakePayment'), name: 'payment', order: 2 },
  { icon: 'eshop-completed', title: translator('Eshop.Order.Completed.Text'), name: 'completed', order: 3 },
]

export const iconByName = function(name) {
  return Icons.find(icon => icon.name === name).icon
}

export default Icons
