import { makeStyles } from "@mui/styles";
import React from "react";
import PropTypes from "prop-types";
import { energieleitungenColorMapping } from "../../utils/constants";
import capitalizeFirstLetter from "../../utils/capitalizeFirstLetter";
import { EnergiePopupSubtitle } from "../../popups/EnergiePopup/EnergiePopup";
const useStyles = makeStyles({
  leitungen: {
    margin: 0,
    padding: 8,
    fontFamily: ["SBBWeb-Bold", "Arial", "sans-serif"],
    "& li": {
      listStyle: "none",
      marginBottom: "5px",
      "&::before": {
        content: '" "',
        margin: "0 10px 3px 0",
        width: "20px",
        height: "4px",
        display: "inline-block"
      }
    }
  },
  los1: {
    "&::before": {
      backgroundColor: energieleitungenColorMapping.los1
    }
  },
  los2: {
    "&::before": {
      backgroundColor: energieleitungenColorMapping.los2
    }
  },
  los3: {
    "&::before": {
      backgroundColor: energieleitungenColorMapping.los3
    }
  },
  los4: {
    "&::before": {
      backgroundColor: energieleitungenColorMapping.los4
    }
  },
  los5: {
    "&::before": {
      backgroundColor: energieleitungenColorMapping.los5
    }
  },
  los6: {
    "&::before": {
      backgroundColor: energieleitungenColorMapping.los6
    }
  },
  los7: {
    "&::before": {
      backgroundColor: energieleitungenColorMapping.los7
    }
  },
  los8: {
    "&::before": {
      backgroundColor: energieleitungenColorMapping.los8
    }
  },
  los9: {
    "&::before": {
      backgroundColor: energieleitungenColorMapping.los9
    }
  },
  los10: {
    "&::before": {
      backgroundColor: energieleitungenColorMapping.los10
    }
  },
  los11: {
    "&::before": {
      backgroundColor: energieleitungenColorMapping.los11
    }
  },
  ausserhalb: {
    "&::before": {
      backgroundColor: energieleitungenColorMapping.ausserhalb
    }
  },
  subtitle: {
    marginLeft: "-30px"
  }
});
function InfoBody(_ref) {
  let {
    name,
    t
  } = _ref;
  const classes = useStyles();
  if (name.match(/ch.sbb.energie(.public)?.unterwerke/)) {
    return /*#__PURE__*/React.createElement(EnergiePopupSubtitle, {
      kategorie: "UW",
      label: capitalizeFirstLetter("".concat(t(name), " (UW), ").concat(t("fahrbare Unterwerke"), " (fUW), ").concat(t("Autotrafo"), " (AT), ").concat(t("Schaltposten"), " 132kV (SP)"))
    });
  }
  if (name.match(/ch.sbb.energie(.public)?.produktionsanlagen/)) {
    return /*#__PURE__*/React.createElement(EnergiePopupSubtitle, {
      kategorie: "KW",
      label: capitalizeFirstLetter("".concat(t("Kraftwerk"), " (KW), ").concat(t("Frequenzumfomer/Umrichter"), " (FU/UR),  ").concat(t("Blindleistungskompensator"), " (BLK)"))
    });
  }
  return /*#__PURE__*/React.createElement("ul", {
    className: classes.leitungen
  }, /*#__PURE__*/React.createElement("li", {
    className: classes.subtitle
  }, t("ch.sbb.energie.leitungen"), " ", t("UL")), Object.keys(energieleitungenColorMapping).map(los => /*#__PURE__*/React.createElement("li", {
    key: los,
    className: classes[los]
  }, t("ch.sbb.energie.".concat(los)))));
}
InfoBody.propTypes = {
  name: PropTypes.string.isRequired,
  t: PropTypes.func.isRequired
};
function EnergieLayerInfo(_ref2) {
  let {
    properties,
    t
  } = _ref2;
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(InfoBody, {
    name: properties.name,
    t: t
  }), /*#__PURE__*/React.createElement("p", null, t("Verantwortlich"), ":", /*#__PURE__*/React.createElement("br", null), "I-EN-DAE-OAN-BUI,\xA0", /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("a", {
    href: "mailto:energienetz-b-i@sbb.ch"
  }, "energienetz-b-i@sbb.ch"), "."));
}
EnergieLayerInfo.propTypes = {
  properties: PropTypes.object.isRequired,
  t: PropTypes.func.isRequired
};
export default EnergieLayerInfo;
//# sourceMappingURL=EnergieLayerInfo.js.map