import React from "react";
import { useSelector } from "react-redux";
import { FaInfo } from "react-icons/fa";
import useTranslation from "../../utils/useTranslation";
import LayerInfosDialog, { NAME as LAYER_INFOS_DIALOG_NAME } from "../LayerInfosDialog";
import DrawRemoveDialog, { NAME as DRAW_REMOVE_DIALOG_NAME } from "../DrawRemoveDialog";
import Dialog from "../Dialog";
import LegalLines from "../LegalLines";
function MainDialog() {
  const {
    t
  } = useTranslation();
  const dialogVisible = useSelector(state => state.app.dialogVisible);
  const language = useSelector(state => state.app.language);
  const selectedForInfos = useSelector(state => state.app.selectedForInfos);
  if (selectedForInfos && dialogVisible === LAYER_INFOS_DIALOG_NAME) {
    return /*#__PURE__*/React.createElement(LayerInfosDialog, {
      selectedForInfos: selectedForInfos
    });
  }
  if (/(Kontakt|Impressum|Rechtliches)/.test(dialogVisible)) {
    return /*#__PURE__*/React.createElement(Dialog, {
      isModal: true,
      name: "legallines",
      title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FaInfo, null), " ", t(dialogVisible)),
      body: /*#__PURE__*/React.createElement(LegalLines, {
        doc: dialogVisible.toLowerCase(),
        language: language
      })
    });
  }
  if (dialogVisible === DRAW_REMOVE_DIALOG_NAME) {
    return /*#__PURE__*/React.createElement(DrawRemoveDialog, null);
  }
  return null;
}
export default MainDialog;
//# sourceMappingURL=MainDialog.js.map