import i18n from '@/vue/i18n';

export const tableColumn = [
  {
    type: 'selection',
    width: 60,
    align: 'center',
  },
  {
    title: '#',
    key: 'index',
    width: 70,
  },
  {
    title: i18n.t('REVIEW_PRODUCT_MODEL'),
    key: 'productModel',
    width: 200,
  },
  {
    title: i18n.t('REVIEW_AUTHOR_NAME'),
    key: 'authorName',
    width: 170,
  },
  {
    title: i18n.t('REVIEW_STAR'),
    key: 'star',
    width: 70,
  },
  {
    title: i18n.t('REVIEW_TIME'),
    key: 'timeCreate',
    width: 120,
  },
  {
    title: i18n.t('REVIEW_COMMENT_TEXT'),
    key: 'comment',
    width: 600,
  },
  {
    title: i18n.t('REVIEW_VIDEO'),
    key: 'video',
    slot: 'video',
    width: 110,
  },
  {
    title: i18n.t('REVIEW_IMAGE'),
    key: 'image',
    slot: 'image',
  },
];

export const excelColumn = {
  product: 'productName',
  username: 'authorName',
  userId: 'userId',
  authorId: 'authorId',
  shopId: 'authorId',
  productId: 'productId',
  [i18n.t('REVIEW_AUTHOR_NAME')]: 'authorName',
  [i18n.t('REVIEW_STAR')]: 'star',
  [i18n.t('REVIEW_TIME')]: 'timeCreate',
  [i18n.t('REVIEW_COMMENT_TEXT')]: 'comment',
  [i18n.t('REVIEW_VIDEO')]: 'videoUrl',
  [i18n.t('REVIEW_IMAGE')]: 'imageUrl',
  orderId: 'orderId',
  cmtId: 'cmtId',
  Tag: 'listTag',
  reply: 'reply',
};

export const listFilter = [
  {
    label: i18n.t('REVIEW_FILTER_ALL'),
    key: 'all',
    type: 0,
    filter: 0,
  },
  {
    label: i18n.t('REVIEW_FILTER_COMMENT'),
    key: 'comment',
    type: 0,
    filter: 1,
  },
  {
    label: i18n.t('REVIEW_FILTER_MEDIA'),
    key: 'media',
    type: 0,
    filter: 3,
  },
  ...[1, 2, 3, 4, 5].map((star) => ({
    label: i18n.t('REVIEW_FILTER_STAR', { star }),
    key: `star-${star}`,
    type: star,
    filter: 0,
  })),
];
