import React from "react";
import PropTypes from "prop-types";
import Feature from "ol/Feature";
import { FaRegFilePdf } from "react-icons/fa";
import Link from "../../components/Link";
import useTranslation from "../../utils/useTranslation";
const propTypes = {
  feature: PropTypes.instanceOf(Feature).isRequired
};
function BahnhofplanPopup(_ref) {
  let {
    feature
  } = _ref;
  const {
    t,
    language
  } = useTranslation();
  const iabpUrl = feature.get("url_interactive_plan");
  const a4Url = feature.get("url_a4");
  const posterUrl = feature.get("url_poster");
  const shoppingUrl = feature.get("url_shopping");
  let iabpLink;
  let a4Link;
  let posterLink;
  let shoppingLink;
  if (iabpUrl) {
    iabpLink = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Link, {
      href: "".concat(iabpUrl, "#?lang=").concat(language)
    }, t("Interaktiver Bahnhofplan")));
  }
  if (a4Url) {
    a4Link = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
      href: a4Url,
      rel: "noopener noreferrer",
      target: "_blank"
    }, t("Format A4"), /*#__PURE__*/React.createElement(FaRegFilePdf, null)));
  }
  if (posterUrl) {
    posterLink = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
      href: posterUrl,
      rel: "noopener noreferrer",
      target: "_blank"
    }, t("Plakat"), /*#__PURE__*/React.createElement(FaRegFilePdf, null)));
  }
  if (shoppingUrl) {
    shoppingLink = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
      href: shoppingUrl,
      rel: "noopener noreferrer",
      target: "_blank"
    }, t("Shopping im Bahnhof"), /*#__PURE__*/React.createElement(FaRegFilePdf, null)));
  }
  return /*#__PURE__*/React.createElement("div", {
    className: "wkp-bahnhofplan-popup"
  }, iabpLink, a4Link, posterLink, shoppingLink);
}
BahnhofplanPopup.propTypes = propTypes;
BahnhofplanPopup.renderTitle = feat => feat.get("name");
export default BahnhofplanPopup;
//# sourceMappingURL=BahnhofplanPopup.js.map