import React from 'react';
import { FormattedMessage } from 'react-intl';
import capWhatsappCTAMsg from '../CapWhatsappCTA/messages';
import capWhatsappMsg from '../../v2Containers/Whatsapp/messages';

export const PHONE_NUMBER = 'PHONE_NUMBER';
export const URL = 'URL';
export const QUICK_REPLY = 'QUICK_REPLY';
export const STATIC_URL = 'STATIC_URL';
export const BTN_MAX_LENGTH = 20;
export const PHONE_NUMBER_MAX_LENGTH = 15;
export const URL_MAX_LENGTH = 2000;
export const carouselButtonOptions = (carouselIndex) => {
  return [
    {
      value: PHONE_NUMBER,
      label: <FormattedMessage {...capWhatsappCTAMsg.ctaPhoneNo} />,
      disabled: carouselIndex > 0,
    },
    {
      value: URL,
      label: <FormattedMessage {...capWhatsappCTAMsg.url} />,
      disabled: carouselIndex > 0,
    },
    {
      value: QUICK_REPLY,
      label: <FormattedMessage {...capWhatsappMsg.btnTypeQuickReply} />,
      disabled: carouselIndex > 0,
    },
  ];
};

export const INITIAL_CAROUSEL_PHONE_NUMBER_DATA = {
  buttonType: PHONE_NUMBER,
  text: '',
  phone_number: '',
  isSaved: false,
  textError: "",
};

export const INITIAL_CAROUSEL_URL_DATA = {
  buttonType: URL,
  text: '',
  urlType: STATIC_URL,
  url: '',
  isSaved: false,
  textError: "",
  urlError: "",
};

export const INITIAL_CAROUSEL_QUICK_REPLY_DATA = {
  text: "",
  buttonType: QUICK_REPLY,
  isSaved: false,
  textError: "",
};
