import { ElementIDUtils } from "@sankhyalabs/core";
import { h } from "@stencil/core";
export const OptionsStep = ({ getMessage, changeInfo, data }) => {
  const selectionCount = (data === null || data === void 0 ? void 0 : data.selectedRows) || 0;
  const formatOptions = [
    { label: getMessage("snkExporter.emailSenderOptStep_formatPDF"), value: "pdf" },
    { label: getMessage("snkExporter.emailSenderOptStep_formatXLS"), value: "xls" }
  ];
  const typeOptions = [
    { label: getMessage("snkExporter.emailSenderOptStep_allData"), value: "all" },
    { label: getMessage("snkExporter.emailSenderOptStep_currentPage"), value: "page" },
  ];
  if (selectionCount > 0) {
    const label = getMessage(selectionCount > 1 ? "snkExporter.emailSenderOptStep_someRecords" : "snkExporter.emailSenderOptStep_oneRecord", { SELECTION_COUNT: selectionCount });
    typeOptions.push({
      label,
      value: "selection"
    });
  }
  return h("div", null, h("ez-radio-button", Object.assign({ class: "ez-margin-bottom--large" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("formato")}` }, { label: getMessage("snkExporter.emailSenderOptStep_lblFormat"), direction: "horizontal", value: data === null || data === void 0 ? void 0 : data.format, onEzChange: evt => changeInfo("format", evt.detail), options: formatOptions })), h("ez-radio-button", Object.assign({ class: "ez-margin-bottom--large" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("type")}` }, { label: getMessage("snkExporter.emailSenderOptStep_export"), value: (data === null || data === void 0 ? void 0 : data.type) || "all", onEzChange: evt => changeInfo("type", evt.detail), options: typeOptions })));
};
