From d57226e5a802ecd6607faf67f32621e2da725a35 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Wed, 19 Jul 2023 00:48:11 -0400 Subject: Moved all components to app folder --- app/travel-advisory/HistoryModal.js | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 app/travel-advisory/HistoryModal.js (limited to 'app/travel-advisory/HistoryModal.js') diff --git a/app/travel-advisory/HistoryModal.js b/app/travel-advisory/HistoryModal.js new file mode 100644 index 0000000..3ef2ea8 --- /dev/null +++ b/app/travel-advisory/HistoryModal.js @@ -0,0 +1,40 @@ +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