import React from "react";
import PropTypes from "prop-types";
import { Layer } from "mobility-toolbox-js/ol";
import useTranslation from "../../utils/useTranslation";
import OperatorShortAndLongName from "../IsbTVSLayerInfo/OperatorShortAndLongName";
const propTypes = {
  properties: PropTypes.instanceOf(Layer).isRequired
};
const translations = {
  de: {
    description: "Infrastrukturbetreiberinnen, die Schmalspurstrecken betreiben.",
    dataInfo1: "Datengrundlage: SBB",
    dataInfo2: "Datenstand: Dezember 2025"
  },
  fr: {
    description: "Les gestionnaires d'infrastructure qui exploitent des lignes à voie étroite.",
    dataInfo1: "Base de données: CFF",
    dataInfo2: "État des données: Décembre 2025"
  },
  it: {
    description: "Gestori di infrastrutture che operano su linee a scartamento ridotto.",
    dataInfo1: "Base dati: FFS",
    dataInfo2: "Aggiornamento dei dati: Dicembre 2025"
  },
  en: {
    description: "Infrastructure managers who operate narrow gauge lines.",
    dataInfo1: "Data basis: SBB",
    dataInfo2: "Data status: December 2025"
  }
};
function IsbSchmalspurLayerInfo(_ref) {
  let {
    properties: layer
  } = _ref;
  const {
    i18n
  } = useTranslation();
  const {
    description,
    dataInfo1,
    dataInfo2
  } = translations[i18n.language];
  const shortToLongName = Object.entries(layer.get("shortToLongName") || {}).sort((_ref2, _ref3) => {
    let [key1] = _ref2;
    let [key2] = _ref3;
    return key1.toUpperCase() < key2.toUpperCase() ? -1 : 1;
  });
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, description), shortToLongName.map(_ref4 => {
    let [shortName, longName] = _ref4;
    return /*#__PURE__*/React.createElement(OperatorShortAndLongName, {
      key: shortName,
      shortName: shortName,
      longName: longName
    });
  }), /*#__PURE__*/React.createElement("p", null, dataInfo1, /*#__PURE__*/React.createElement("br", null), dataInfo2));
}
IsbSchmalspurLayerInfo.propTypes = propTypes;
export default /*#__PURE__*/React.memo(IsbSchmalspurLayerInfo);
//# sourceMappingURL=IsbSchmalspurLayerInfo.js.map