import React from "react";
import PropTypes from "prop-types";
import Feature from "ol/Feature";
import { Typography, Link } from "@mui/material";
import { ReactComponent as LinkIcon } from "../../components/Link/Link.svg";
import useTranslation from "../../utils/useTranslation";
const propTypes = {
  feature: PropTypes.instanceOf(Feature).isRequired
};
function PassagierFrequenzenPopup(_ref) {
  let {
    feature
  } = _ref;
  const {
    t,
    language
  } = useTranslation();
  const statisticDate = feature.get("passagier_freq_jahr");
  const dwv = feature.get("dwv").toString().replace(/\B(?=(\d{3})+(?!\d))/g, "\u2009");
  const remark = feature.get("passagier_freq_bemerkungen_".concat(language));
  const evu = feature.get("passagier_freq_evu_".concat(language));
  const url = feature.get("passagier_freq_url");
  return /*#__PURE__*/React.createElement("div", {
    className: "wkp-passagier-freq-popup"
  }, /*#__PURE__*/React.createElement("div", {
    className: "wkp-passagier-freq-popup-body"
  }, /*#__PURE__*/React.createElement(Typography, null, t("passagier_freq_anzahl")), /*#__PURE__*/React.createElement(Typography, {
    paragraph: true
  }, "".concat(dwv, " ").concat(t("Ein- und Aussteigende"))), /*#__PURE__*/React.createElement(Typography, {
    paragraph: true
  }, t("passagier_freq_jahr"), " ", statisticDate), evu ? /*#__PURE__*/React.createElement(Typography, {
    paragraph: true
  }, evu) : null, remark ? /*#__PURE__*/React.createElement(Typography, {
    paragraph: true
  }, /*#__PURE__*/React.createElement("i", null, remark)) : null, url ? /*#__PURE__*/React.createElement(Typography, null, t("Detaillierter Datensatz auf"), " ", /*#__PURE__*/React.createElement(Link, {
    href: url,
    rel: "noopener noreferrer",
    target: "_blank",
    style: {
      textDecoration: "none"
    }
  }, "data.sbb.ch ", /*#__PURE__*/React.createElement(LinkIcon, null))) : null));
}
PassagierFrequenzenPopup.propTypes = propTypes;
const composed = PassagierFrequenzenPopup;
composed.renderTitle = feat => feat.get("name");
export default composed;
//# sourceMappingURL=PassagierFrequenzenPopup.js.map