import React from "react";
import PropTypes from "prop-types";
import { Typography } from "@mui/material";
import isoToIntlVehicleCode from "../../utils/isoToIntlVehicleCode";
const propTypes = {
  properties: PropTypes.shape({
    name: PropTypes.string,
    municipality_name: PropTypes.string,
    country_code: PropTypes.string
  })
};
function StopSearchResult(_ref) {
  let {
    properties = {}
  } = _ref;
  if (!properties) {
    return null;
  }
  const {
    name: title,
    municipality_name: municipality,
    country_code: countryCode
  } = properties;
  let subtitle = municipality;
  if (!municipality && countryCode) {
    subtitle = isoToIntlVehicleCode(countryCode);
  }
  if (municipality && countryCode) {
    subtitle = "".concat(municipality, " (").concat(isoToIntlVehicleCode(properties.country_code), ")");
  }
  return title && /*#__PURE__*/React.createElement("div", {
    className: "wkp-search-suggestion-subtitled",
    "data-testid": "stopfinder-search-result"
  }, /*#__PURE__*/React.createElement(Typography, null, title), subtitle ? /*#__PURE__*/React.createElement(Typography, {
    variant: "subtitle1"
  }, subtitle) : null);
}
StopSearchResult.propTypes = propTypes;
export default StopSearchResult;
//# sourceMappingURL=StopSearchResult.js.map