export const drapcodeSectionRef = "drapcode-sections";
export const drapcodeSectionPluginRef = "gjs-drapcode-sections";
import { sectionModalViews } from "./modalViewConstants";
import { sectionBlockCodes } from "./codesConstants";

const sections = [
  "section11Empty",
  "section22Empty",
  "section33Empty",
  "section44Empty",
  "section11",
  "section22",
  "section33",
  "section44",
  "section4060",
  "section6040",
  "section633",
  "section363",
  "section2columns",
  "section3columns",
  "section4columns",
  "section2columnsHB",
  "section3columnsHB",
  "section4columnsHB",
  "section2columns3RowsList",
  "section2columns3RowsListWithHeader",
  "section1rowForm",
  "section3rows",
  "section3rowsLeftAlign",
  "section3rowsSimple",
];

let sectionsMap = [];

sections.forEach((sectionName) => {
  let galleryView = sectionModalViews.filter(
    (gv) => gv.name === sectionName
  )[0];
  let sectionBlock = sectionBlockCodes.filter(
    (sbc) => sbc.name === sectionName
  )[0];

  sectionsMap.push({
    label: galleryView.label,
    value: sectionName,
    view: galleryView.content,
    code: sectionBlock.content,
  });
});

export const defaultSectionsMap = [...sectionsMap];
