From ddbe4fa61425f6a871a23238ce15a0929e201e6e Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 17 Jul 2023 15:08:57 -0400 Subject: Modularizing certain elements; Working information section --- components/travel-advisory/HistoryModal.js | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 components/travel-advisory/HistoryModal.js (limited to 'components/travel-advisory/HistoryModal.js') diff --git a/components/travel-advisory/HistoryModal.js b/components/travel-advisory/HistoryModal.js new file mode 100644 index 0000000..ad9c039 --- /dev/null +++ b/components/travel-advisory/HistoryModal.js @@ -0,0 +1,42 @@ +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 ( +
  • {event}
  • + ) + }) + } else { + historyList =
  • Currently no diplomatic tensions in this country.
  • ; + } + + return ( +
    +
    +
    +
    +
    +
    +

    {countries}

    +

    {dangerLevel}

    +
    +
    +

    History

    +
      + {historyList} +
    +
    +
    +
    +
    +
    +
    + ) +} + +export default HistoryModal; -- cgit v1.2.3