/* eslint-disable jsx-a11y/anchor-is-valid */
import React, { useMemo } from "react";
import { useDispatch, useSelector } from "react-redux";
import ScaleLine from "react-spatial/components/ScaleLine";
import MousePosition from "react-spatial/components/MousePosition";
import { Link } from "@mui/material";
import useTranslation from "../../utils/useTranslation";
import ProjectionSelect from "../ProjectionSelect";
import coordinateHelper from "../../utils/coordinateHelper";
import { setDialogVisible } from "../../model/app/actions";
import "./Footer.scss";
function Footer() {
  const dispatch = useDispatch();
  const {
    t
  } = useTranslation();
  const map = useSelector(state => state.app.map);
  const projection = useSelector(state => state.app.projection);
  const consentGiven = useSelector(state => state.app.consentGiven);
  const projections = useMemo(() => {
    return [{
      label: "CH1903 / LV03",
      value: "EPSG:21781",
      format: c => "".concat(t("Koordinaten"), ": ").concat(coordinateHelper.meterFormat(c))
    }, {
      label: "CH1903+ / LV95",
      value: "EPSG:2056",
      format: c => "".concat(t("Koordinaten"), ": ").concat(coordinateHelper.meterFormat(c))
    }, {
      label: "Web Mercator",
      value: "EPSG:3857",
      format: c => "".concat(t("Koordinaten"), ": ").concat(coordinateHelper.meterFormat(c))
    }, {
      label: "WGS 84",
      value: "EPSG:4326",
      format: c => "".concat(t("Koordinaten"), ": ").concat(coordinateHelper.wgs84Format(c))
    }];
  }, [t]);
  return /*#__PURE__*/React.createElement("div", {
    className: "wkp-footer"
  }, /*#__PURE__*/React.createElement("div", {
    className: "wkp-footer-left"
  }, /*#__PURE__*/React.createElement(ScaleLine, {
    map: map
  }), /*#__PURE__*/React.createElement(ProjectionSelect, {
    projections: projections
  }), /*#__PURE__*/React.createElement(MousePosition, {
    map: map,
    projections: projections,
    projectionValue: projection
  })), /*#__PURE__*/React.createElement("div", {
    className: "wkp-footer-right"
  }, consentGiven && /*#__PURE__*/React.createElement(Link, {
    component: "button",
    className: "wkp-cookies-link"
    // eslint-disable-next-line no-undef
    ,
    onClick: () => {
      window.Optanon.ToggleInfoDisplay();
    },
    tabIndex: "0"
  }, t("Cookie-Einstellungen")), /*#__PURE__*/React.createElement(Link, {
    component: "button",
    onClick: () => dispatch(setDialogVisible("Kontakt")),
    tabIndex: "0"
  }, t("Kontakt")), /*#__PURE__*/React.createElement(Link, {
    component: "button",
    onClick: () => dispatch(setDialogVisible("Impressum")),
    tabIndex: "0"
  }, t("Impressum")), /*#__PURE__*/React.createElement(Link, {
    component: "button",
    onClick: () => dispatch(setDialogVisible("Rechtliches")),
    tabIndex: "0"
  }, t("Rechtliches")), /*#__PURE__*/React.createElement(Link, {
    className: "wkp-dev-portal-link",
    href: "https://doc.trafimage.ch",
    rel: "noopener noreferrer",
    target: "_blank",
    tabIndex: "0"
  }, "Developer Portal")));
}
export default /*#__PURE__*/React.memo(Footer);
//# sourceMappingURL=Footer.js.map