/* eslint-disable import/no-absolute-path */ import React, { Fragment } from 'react'; import { Popup, Tooltip } from 'react-leaflet'; import PropTypes from 'prop-types'; import { translate } from 'react-i18next'; import moment from 'moment'; const FirePopup = ({ lat, lon, nasa, id, history, when, t }) => ( {t('Coordenadas:')} {lat}, {lon}
{nasa && {t('Fuente')}: {t(nasa ? 'NASA' : 'nuestros usuarios/as')}
} {when && {t('Detectado')}: {moment(when).fromNow()}
} { /* if nasa === null means that the is a false positive fire */ } history.push(`/fire/${nasa ? 'active' : 'archive'}/${id}`)}>{t('Más información sobre este fuego')}
{t('Pulsa para más información')}
); FirePopup.propTypes = { // https://github.com/PaulLeCam/react-leaflet/tree/master/src/propTypes lat: PropTypes.number.isRequired, lon: PropTypes.number.isRequired, nasa: PropTypes.bool, id: PropTypes.object.isRequired, history: PropTypes.object.isRequired, when: PropTypes.instanceOf(Date), t: PropTypes.func.isRequired }; export default translate([], { wait: true })(FirePopup);