import React, { useMemo } from "react";
import useTranslation from "../../utils/useTranslation";
import { DV_DAY_LAYER_KEY, DV_NIGHT_LAYER_KEY, getDirektverbindungenLayers } from "../../config/ch.sbb.direktverbindungen";
import DataLink from "../../components/DataLink";
import DvLegendLine from "../../config/ch.sbb.direktverbindungen/DvLegendLine/DvLegendLine";
function DvTopicInfo() {
  const {
    t,
    i18n
  } = useTranslation();
  const layers = useMemo(() => {
    return getDirektverbindungenLayers();
  }, []);
  const dvDay = layers.find(l => l.key === DV_DAY_LAYER_KEY);
  const dvNight = layers.find(l => l.key === DV_NIGHT_LAYER_KEY);
  const legend = [dvDay, dvNight].map(layer => /*#__PURE__*/React.createElement("div", {
    style: {
      margin: "10px 0",
      display: "flex",
      alignItems: "center",
      gap: 10
    },
    key: layer.key
  }, /*#__PURE__*/React.createElement(DvLegendLine, {
    color: layer.get("color")
  }), t(layer.name)));
  const dataLink = dvDay.get("dataLink") && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("hr", null), /*#__PURE__*/React.createElement("p", {
    style: {
      marginBottom: 0
    }
  }, /*#__PURE__*/React.createElement(DataLink, {
    layer: dvDay
  })), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(DataLink, {
    href: "https://geo.sbb.ch/portal/home/group.html?id=4778f8efa0ad41a6829f0094339158e2#overview"
  }, t("Zu den Trafimage-Datensätzen im SBB Geoportal (SBB-intern)"))));
  return /*#__PURE__*/React.createElement(React.Fragment, null, i18n.language === "de" && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, "Die Karte bildet alle Fernverkehrsverbindungen ab, welche direkt ab der Schweiz nach Europa verkehren. Auf der Karte k\xF6nnen Informationen zu allen abgebildeten Linien mit einem Klick abgefragt werden. Es besteht die Option nur Tages- oder nur Nachtzuglinien anzuzeigen."), legend, /*#__PURE__*/React.createElement("p", null, "Datenstand Dezember 2025.", /*#__PURE__*/React.createElement("br", null), "Die Karte wird j\xE4hrlich zum Fahrplanwechsel aktualisiert.", /*#__PURE__*/React.createElement("br", null), "Direktverbindungen nach Europa, SBB AG"), dataLink), i18n.language === "fr" && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, "La carte repr\xE9sente toutes les liaisons longue distance qui circulent directement de la Suisse vers l'Europe. Sur la carte, il est possible d'obtenir des informations sur toutes les lignes repr\xE9sent\xE9es en un seul clic. Il est possible d'afficher uniquement les lignes de jour ou uniquement les lignes de nuit."), legend, /*#__PURE__*/React.createElement("p", null, "Mise \xE0 jour des donn\xE9es en d\xE9cembre 2025.", /*#__PURE__*/React.createElement("br", null), "La carte est actualis\xE9e chaque ann\xE9e lors du changement d'horaire.", /*#__PURE__*/React.createElement("br", null), "Trafic voyageurs international, CFF SA"), dataLink), i18n.language === "en" && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, "The map shows all long-distance services that run directly from Switzerland to Europe. Information on all the lines shown on the map can be called up with one click. There is the option to display only day or only night train lines."), legend, /*#__PURE__*/React.createElement("p", null, "Data updated in December 2025.", /*#__PURE__*/React.createElement("br", null), "The map is updated annually at the time of the timetable change.", /*#__PURE__*/React.createElement("br", null), "International Passenger Traffic, SBB"), dataLink), i18n.language === "it" && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, "La mappa mostra tutti i collegamenti a lunga percorrenza che circolano direttamente tra la Svizzera e l'Europa. Le informazioni su tutte le linee mostrate sulla mappa possono essere richiamate con un clic. C'\xE8 l'opzione di visualizzare solo le linee ferroviarie diurne o solo quelle notturne."), legend, /*#__PURE__*/React.createElement("p", null, "Stato dei dati dicembre 2025.", /*#__PURE__*/React.createElement("br", null), "La mappa viene aggiornata ogni anno al momento del cambio d'orario.", /*#__PURE__*/React.createElement("br", null), "Traffico passeggeri internazionale, FFS"), dataLink));
}
export default /*#__PURE__*/React.memo(DvTopicInfo);
//# sourceMappingURL=DvTopicInfo.js.map