import lodash from 'lodash';
import { getGptConfig } from '@/config/platform/get';

/**
 *
 * @param {ShopPlatform} platform
 * @returns
 */
export const getKeyProductClone = (platform) => {
  const mapPlatfrom = {
    lazada: 'lazadaClone',
    tiktok: 'tiktokClone',
  };

  const getKey = mapPlatfrom[platform];

  return `userData.limitInc.${getKey}`;
};

/**
 *
 * @param {UserExtensionPlan} extensionPlan
 * @returns {boolean}
 */
export const getGptWriterUserPlanAllow = (extensionPlan) => lodash.get(getGptConfig(), 'gptWriter.requiredPlan', ['VipPlus']).includes(extensionPlan);
