import React from "react";
import { Select } from "antd";
import i18n from "../translations/i18n";

export default function CiecaSelect(parts = true, labor = true) {
  return (
    <>
      {labor && (
        <>
          <Select.Option value="LAA">{i18n.t("joblines.fields.lbr_types.LAA")}</Select.Option>
          <Select.Option value="LAB">{i18n.t("joblines.fields.lbr_types.LAB")}</Select.Option>
          <Select.Option value="LAD">{i18n.t("joblines.fields.lbr_types.LAD")}</Select.Option>
          <Select.Option value="LAE">{i18n.t("joblines.fields.lbr_types.LAE")}</Select.Option>
          <Select.Option value="LAF">{i18n.t("joblines.fields.lbr_types.LAF")}</Select.Option>
          <Select.Option value="LAG">{i18n.t("joblines.fields.lbr_types.LAG")}</Select.Option>
          <Select.Option value="LAM">{i18n.t("joblines.fields.lbr_types.LAM")}</Select.Option>
          <Select.Option value="LAR">{i18n.t("joblines.fields.lbr_types.LAR")}</Select.Option>
          <Select.Option value="LAS">{i18n.t("joblines.fields.lbr_types.LAS")}</Select.Option>
          <Select.Option value="LAU">{i18n.t("joblines.fields.lbr_types.LAU")}</Select.Option>
          <Select.Option value="LA1">{i18n.t("joblines.fields.lbr_types.LA1")}</Select.Option>
          <Select.Option value="LA2">{i18n.t("joblines.fields.lbr_types.LA2")}</Select.Option>
          <Select.Option value="LA3">{i18n.t("joblines.fields.lbr_types.LA3")}</Select.Option>
          <Select.Option value="LA4">{i18n.t("joblines.fields.lbr_types.LA4")}</Select.Option>
        </>
      )}
      {parts && (
        <>
          <Select.Option value="PAA">{i18n.t("joblines.fields.part_types.PAA")}</Select.Option>
          <Select.Option value="PAC">{i18n.t("joblines.fields.part_types.PAC")}</Select.Option>

          <Select.Option value="PAL">{i18n.t("joblines.fields.part_types.PAL")}</Select.Option>
          <Select.Option value="PAG">{i18n.t("joblines.fields.part_types.PAG")}</Select.Option>
          <Select.Option value="PAM">{i18n.t("joblines.fields.part_types.PAM")}</Select.Option>
          <Select.Option value="PAP">{i18n.t("joblines.fields.part_types.PAP")}</Select.Option>
          <Select.Option value="PAN">{i18n.t("joblines.fields.part_types.PAN")}</Select.Option>
          <Select.Option value="PAO">{i18n.t("joblines.fields.part_types.PAO")}</Select.Option>
          <Select.Option value="PAR">{i18n.t("joblines.fields.part_types.PAR")}</Select.Option>
          <Select.Option value="PAS">{i18n.t("joblines.fields.part_types.PAS")}</Select.Option>
        </>
      )}
    </>
  );
}

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()}`);
}
