import i18n from '@/vue/i18n';

export const listState = [
  {
    label: i18n.t('ADS_CAMPAGIN_STATUS.all'),
    value: 'auto',
  },
  {
    label: i18n.t('ADS_CAMPAGIN_STATUS.ongoing'),
    value: 'ongoing',
  },
];

export const listType = [
  {
    label: i18n.t('ADS_CAMPAGIN_TYPE.keyword'),
    value: 'keyword',
  },
  {
    label: i18n.t('ADS_CAMPAGIN_TYPE.shop'),
    value: 'shop',
  },
];

export const tableCampaginColumn = [
  {
    title: '#',
    key: 'index',
    width: 60,
  },
  {
    title: i18n.t('ADS_CAMPAGIN_COLUM_TYPE'),
    key: 'type',
    width: 100,
  },
  {
    title: i18n.t('ADS_CAMPAGIN_COLUM_NAME'),
    key: 'name',
    slot: 'name',
  },
  {
    title: i18n.t('ADS_CAMPAGIN_COLUM_KEYWORD'),
    key: 'countKeyword',
    width: 100,
  },
  {
    title: i18n.t('ADS_CAMPAGIN_COLUM_STATE'),
    key: 'state',
    width: 100,
  },
  {
    title: i18n.t('ADS_CAMPAGIN_COLUM_START'),
    key: 'timeStart',
    width: 120,
  },
  {
    title: i18n.t('ADS_CAMPAGIN_COLUM_DAILY_EXPENSE'),
    key: 'dailyExpense',
    width: 120,
  },
  {
    title: i18n.t('ADS_CAMPAGIN_COLUM_DAILY_QUOTA'),
    key: 'dailyQuota',
    width: 120,
  },
  {
    title: i18n.t('ADS_CAMPAGIN_COLUM_TOTAL_EXPENSE'),
    key: 'totalExpense',
    width: 120,
  },
];

export const tableKeywordColumn = [
  {
    type: 'selection',
    width: 60,
    align: 'center',
  },
  {
    title: '#',
    key: 'index',
    width: 60,
  },
  {
    title: i18n.t('KEYWORD_COLUM.KEYWORD'),
    key: 'keyword',
    slot: 'keyword',
    width: 220,
  },
  {
    title: i18n.t('KEYWORD_COLUM.TYPE'),
    slot: 'type',
    width: 120,
    key: 'type',
  },
  {
    title: i18n.t('KEYWORD_COLUM.PRICE_OLD'),
    key: 'priceOld',
  },
  {
    title: i18n.t('KEYWORD_COLUM.PRICE_CHANGE'),
    key: 'price',
    slot: 'price',
  },
  // {
  //   title: i18n.t('KEYWORD_COLUM.STATUS'),
  //   key: 'isActive',
  //   slot: 'active',
  // },
  {
    title: i18n.t('TABLE_COLUM_ACTION'),
    slot: 'action',
  },
];

/**
 *
 * @param {number} num
 * @returns  {number}
 */

export const roundNumber = (num) => Math.floor(num, 0);

/**
 *
 * @param {number} num
 * @returns {Date}
 */
export const unixTime = (num) => new Date(num * 1000);
