const HistoryModal = ({ isVisible, onClose, countries, dangerLevel, history }) => { if (!isVisible) return null; const handleClose = (e) => { if(e.target.id === 'wrapper') onClose(); } let historyList; if (history && history.length > 0) { historyList = history.map((event, index) => { return (