import i18n from "../translations/i18n";

export default function CiecaSelect(parts = true, labor = true) {
  const options = [];
  
  if (labor) {
    options.push(
      { value: "LAA", label: i18n.t("joblines.fields.lbr_types.LAA") },
      { value: "LAB", label: i18n.t("joblines.fields.lbr_types.LAB") },
      { value: "LAD", label: i18n.t("joblines.fields.lbr_types.LAD") },
      { value: "LAE", label: i18n.t("joblines.fields.lbr_types.LAE") },
      { value: "LAF", label: i18n.t("joblines.fields.lbr_types.LAF") },
      { value: "LAG", label: i18n.t("joblines.fields.lbr_types.LAG") },
      { value: "LAM", label: i18n.t("joblines.fields.lbr_types.LAM") },
      { value: "LAR", label: i18n.t("joblines.fields.lbr_types.LAR") },
      { value: "LAS", label: i18n.t("joblines.fields.lbr_types.LAS") },
      { value: "LAU", label: i18n.t("joblines.fields.lbr_types.LAU") },
      { value: "LA1", label: i18n.t("joblines.fields.lbr_types.LA1") },
      { value: "LA2", label: i18n.t("joblines.fields.lbr_types.LA2") },
      { value: "LA3", label: i18n.t("joblines.fields.lbr_types.LA3") },
      { value: "LA4", label: i18n.t("joblines.fields.lbr_types.LA4") }
    );
  }
  
  if (parts) {
    options.push(
      { value: "PAA", label: i18n.t("joblines.fields.part_types.PAA") },
      { value: "PAC", label: i18n.t("joblines.fields.part_types.PAC") },
      { value: "PAL", label: i18n.t("joblines.fields.part_types.PAL") },
      { value: "PAG", label: i18n.t("joblines.fields.part_types.PAG") },
      { value: "PAM", label: i18n.t("joblines.fields.part_types.PAM") },
      { value: "PAP", label: i18n.t("joblines.fields.part_types.PAP") },
      { value: "PAN", label: i18n.t("joblines.fields.part_types.PAN") },
      { value: "PAO", label: i18n.t("joblines.fields.part_types.PAO") },
      { value: "PAR", label: i18n.t("joblines.fields.part_types.PAR") },
      { value: "PAS", label: i18n.t("joblines.fields.part_types.PAS") }
    );
  }
  
  return options;
}

export function GetPartTypeName(part_type) {
  if (!part_type) return null;
  return i18n.t(`joblines.fields.part_types.${part_type.toUpperCase()}`);
}

export function Get(part_type) {
  if (!part_type) return null;
  return i18n.t(`joblines.fields.part_types.${part_type.toUpperCase()}`);
}
