export function getThumb(imageUrl) {
  const url = new URL(`${window.TeleCart.shop_base_url}/admin/index.php`);
  url.searchParams.set('route', 'extension/module/tgshop/handle');
  url.searchParams.set('api_action', 'getImage');
  url.searchParams.set('path', imageUrl);
  url.searchParams.set('size', '100x100');
  url.searchParams.set('user_token', window.TeleCart.user_token);
  return url.toString();
}

export function rub(value) {
  return new Intl.NumberFormat('ru-RU', {
    style: 'currency',
    currency: 'RUB',
    maximumFractionDigits: 0
  }).format(value);
}
