function getWidgetData(type) {
  var widgetData = {};

  var padding = {
    top: 10,
    bottom: 10,
    right: 10,
    left: 10,
  };

  switch (type) {
    case "radiogroup_widget":
      widgetData = {
        type: type,
        // properties: ['color', 'text-properties', 'form-design', 'general'],
        value: {
          Ans: "",
        },
        style: {
          size: 21,
          radioColor: "#5bc0de",
          boxColor: "info-o",
          boxStyle: "p-default p-round p-thick",
          boxType: "",
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          boxborder: true,
          headingColor: "#005CB9",
          padding: padding,
        },
        text: {
          qheading: "Q. Write Your Question Number",
          question: "Here you can add your Question",
          Answers: [
            {
              text: "Option 1",
              value: 1,
            },
            {
              text: "Option 2",
              value: 2,
            },
            {
              text: "Option 3",
              value: 3,
            },
            {
              text: "Option 4",
              value: 4,
            },
          ],
        },
      };
      break;
    case "checkbox_widget":
      widgetData = {
        type: type,
        // properties: ['color', 'text-properties', 'form-design', 'general'],
        value: {
          Ans: [],
        },
        style: {
          size: 21,
          radioColor: "#5bc0de",
          boxColor: "info-o",
          boxStyle: "p-default p-thick",
          boxType: "",
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          headingColor: "#005CB9",
          boxborder: true,
          padding: padding,
        },
        text: {
          qheading: "Q. Write Your Question Number",
          question: "Here you can add your Question",
          Answers: [
            {
              text: "Option 1",
              value: 1,
            },
            {
              text: "Option 2",
              value: 2,
            },
            {
              text: "Option 3",
              value: 3,
            },
            {
              text: "Option 4",
              value: 4,
            },
          ],
        },
      };
      break;
    case "text_widget":
      widgetData = {
        type: type,
        // properties: ['color', 'text-editor', 'general'],
        style: {
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          padding: padding,
        },
        html: "<p style='text-align: justify;'><b>Lorem Ipsum</b> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>",
      };
      break;
    case "image_widget":
      widgetData = {
        type: type,
        // properties: ['action-properties', 'color', 'image-properties', 'general'],
        value: {
          type: type,
          ImageUrl: "",
          ImageUrlLink: "",
        },
        style: {
          backgroundcolor: "#FFFFFF00",
          padding: padding,
          newTab: "Same Tab",
          linkUrl: null,
          imgurl:
            "https://s3-ap-southeast-1.amazonaws.com/vemessage-images/1554011171959-500x100.png",
          imgsize: 80,
          position: "center",
        },
      };
      break;
    case "socials_widget":
      widgetData = {
        type: type,
        value: {},
        style: {
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          padding: padding,
        },
        text: {
          socialsLinks: [
            {
              name: "circle_Black_Facebook",
              title: "Facebook",
              imagelink:
                "https://s3.ap-southeast-1.amazonaws.com/vemessage-images/1553929638334-Facebook.png",
            },
            {
              name: "circle_Black_Twiter",
              title: "Twiter",
              imagelink:
                "https://s3.ap-southeast-1.amazonaws.com/vemessage-images/1553929769726-Twiter.png",
            },
            {
              name: "circle_Black_Instagram",
              title: "Instagram",
              imagelink:
                "https://s3.ap-southeast-1.amazonaws.com/vemessage-images/1553929675528-Instagram.png",
            },
          ],
        },
      };
      break;
    case "links_widget":
      widgetData = {
        type: type,
        value: "",
        style: {
          backgroundcolor: "#FFFFFF00",
          textcolor: "#005CB9",
          padding: padding,
        },
        text: {
          links: [
            {
              name: "Home",
              url: "https://vemessage.com/",
            },
            {
              name: "About",
              url: "https://vemessage.com/",
            },
            {
              name: "contact",
              url: "https://vemessage.com/",
            },
          ],
        },
      };
      break;
    case "single_input_widget":
      widgetData = {
        type: type,
        // properties: ['color', 'text-properties', 'general'],
        value: "",
        style: {
          formBody: {
            borderType: "solid",
            borderColor: "#CCC",
            borderWidth: 1,
            borderActive: "#F6F6F6",
          },
          borderRadius: 5,
          size: "md",
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          headingColor: "#005CB9",
          padding: padding,
        },
        text: {
          heading: "Write your single input question",
          subheading: "Please Type here Answer",
          type: "Input text",
          InputPlaceholder: "",
          inputValue: "",
          inputType: "text",
        },
      };
      break;
    case "text_area_widget":
      widgetData = {
        type: type,
        value: "",
        style: {
          formBody: {
            borderType: "solid",
            borderColor: "#CCC",
            borderWidth: 1,
            borderActive: "#F6F6F6",
            rows: 5,
            maxRows: 5,
          },
          borderRadius: 5,
          size: "md",
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          headingColor: "#005CB9",
          padding: padding,
        },
        text: {
          heading: "Write your text area question",
          subheading: "Please Type here Answer",
          type: "text",
          InputPlaceholder: "",
        },
      };
      break;
    case "date_widget":
      widgetData = {
        type: type,
        value: "",
        style: {
          formBody: {
            borderType: "solid",
            borderColor: "#CCC",
            borderWidth: 1,
            borderActive: "#F6F6F6",
          },
          borderRadius: 5,
          size: "md",
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          headingColor: "#005CB9",
          padding: padding,
        },
        text: {
          heading: "Select your date",
          subheading: "Please pick a date",
          InputPlaceholder: "Date",
        },
      };
      break;
    case "time_widget":
      widgetData = {
        type: type,
        value: "",
        style: {
          formBody: {
            borderType: "solid",
            borderColor: "#CCC",
            borderWidth: 1,
            borderActive: "#F6F6F6",
          },
          borderRadius: 5,
          size: "md",
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          headingColor: "#005CB9",
          padding: padding,
        },
        text: {
          heading: "Select your time",
          subheading: "Please pick a time",
          InputPlaceholder: "Time",
        },
      };
      break;
    case "ratting_widget":
      widgetData = {
        type: type,
        // properties: ['color', 'text-properties', 'general'],
        value: {
          Ans: 0,
        },
        style: {
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          headingColor: "#005CB9",
          padding: padding,
        },
        text: {
          rattingHeading: "How do You Rate Us",
          rattingsubHeading: "1 being Lowest & 5 being Hightest",
        },
      };
      break;
    case "boolean_widget":
      widgetData = {
        type: type,
        // properties: ['color', 'text-properties', 'general'],
        value: {
          Ans: {
            id: null,
            value: "",
          },
        },
        style: {
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          headingColor: "#005CB9",
          padding: padding,
        },
        text: {
          booleanHeading: "Make a Choice",
          booleansubHeading:
            "Yes Or No, Agree Or Not, Like or Dislike, Confirm or Cancel",
          booleanOption: {
            true: "Yes",
            false: "No",
          },
        },
      };
      break;
    case "file_upload_widget":
      widgetData = {
        type: type,
        // properties: ['file-properties', 'color', 'text-properties', 'general'],
        value: {
          Ans: "",
        },
        style: {
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          padding: padding,
        },
      };
      break;
    case "slider_widget":
      widgetData = {
        type: type,
        value: "",
        style: {
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          padding: padding,
        },
      };
      break;
    case "submit_button_widget":
      widgetData = {
        type: type,
        // properties: ['color', 'button-properties', 'general'],
        value: "",
        style: {
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          buttoncolor: "#005CB9",
          buttonTextColor: "#FFF",
          buttonHoverColor: "#FFF",
          ButtonHoverTextColor: "#000",
          ButtonBorderColor: "#005CB9",
          ButtonBorder: 0,
          padding: padding,
        },
        text: {
          buttonText: "Submit",
        },
      };
      break;
    case "camraRecord":
      widgetData = {
        type: type,
        component: camraRecord,
        value: "",
        style: {
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          padding: padding,
        },
      };
      break;
    case "voice_record_widget":
      widgetData = {
        type: type,
        value: "",
        style: {
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          padding: padding,
        },
      };
      break;
    case "dropdown_widget":
      widgetData = {
        type: type,
        // properties: ['color', 'text-properties', 'general'],
        value: {
          Ans: "",
        },
        style: {
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          headingColor: "#005CB9",
          padding: padding,
        },
        text: {
          qheading: "Q. Write Your Question Number",
          question: "Here you can add your Question",
          Answers: [
            {
              text: "Option 1",
              value: "value " + 1,
              id: 1,
            },
            {
              text: "Option 2",
              value: "value " + 2,
              id: 2,
            },
            {
              text: "Option 3",
              value: "value " + 3,
              id: 3,
            },
            {
              text: "Option 4",
              value: "value " + 4,
              id: 4,
            },
          ],
        },
      };
      break;
    case "groups_widget":
      widgetData = {
        type: type,
        // properties: ['color', 'text-properties', 'general'],
        value: {
          Ans: "",
        },
        style: {
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          headingColor: "#005CB9",
          padding: padding,
        },
        text: {
          qheading: "Q. Write Your Question Number",
          question: "Here you can add your Question",
          spaceId: "",
          Answers: [],
        },
      };
      break;
    case "youtube_widget":
      widgetData = {
        type: type,
        // properties: ['color', 'text-properties', 'general'],
        value: {
          Ans: 0,
        },
        style: {
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          headingColor: "#005CB9",
          padding: padding,
        },
        text: {
          youtubeVideoId: "ybhKG682sKA",
        },
      };
      break;
    case "image_slider_widget":
      widgetData = {
        type: type,
        // properties: ['color', 'text-properties', 'general'],
        value: {},
        style: {
          backgroundcolor: "#FFFFFF00",
          textcolor: "#000",
          headingColor: "#005CB9",
          padding: padding,
        },
        text: {
          heading: "Image and discription carousel",
          subheading: "Add up to 3 images and descriptions to cycle through",
          images: [
            {
              imageUrl:
                "https://s3.ap-southeast-1.amazonaws.com/vemessage-images/1625659485921-6649a1141601a9ee020684713ba1c4ec8f6.jpg",
              caption: "image 1 caption",
            },
            {
              imageUrl:
                "https://s3.ap-southeast-1.amazonaws.com/vemessage-images/1625659485921-6649a1141601a9ee020684713ba1c4ec8f6.jpg",
              caption: "image 2 caption",
            },
            {
              imageUrl:
                "https://s3.ap-southeast-1.amazonaws.com/vemessage-images/1625659485921-6649a1141601a9ee020684713ba1c4ec8f6.jpg",
              caption: "image 3 caption",
            },
          ],
        },
      };
      break;
  }
  return widgetData;
}

export const addToWidgetList = (widgetDataList, widgetType, insertAtIndex) => {
  widgetDataList.splice(insertAtIndex, 0, getWidgetData(widgetType));
  return widgetDataList;
};
