function renderPopup(feature) {
  let properties = feature
  if (feature.type === 'Feature') {
    properties = feature.properties
  }
  return `
    <div class="popup">
      ${Object.entries(properties)
        .map(item => renderItem(item))
        .join('')}
    </div>
  `
}
function renderItem(item) {
  let key = item[0]
  let value = item[1]
  if (key === 'coordinates' || key === '_id') {
    return ''
  }
  return `
    <div>
      <span style="display:inline-block;width: 90px;word-break: keep-all;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;color:#838383;" title="${key}">${key}</span>
      <span style="display:inline-block;max-width: 125px;word-break: keep-all;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="${value}">${value}</span>
     </div>
  `
}

export default renderPopup
