From 649b1d4328a7ffc31cb5e9d47e2b3ddefcc66f16 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 24 Jul 2023 20:27:10 -0400 Subject: Initial rewrite to astro --- src/components/travel-advisory/HistoryModal.jsx | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/components/travel-advisory/HistoryModal.jsx (limited to 'src/components/travel-advisory/HistoryModal.jsx') diff --git a/src/components/travel-advisory/HistoryModal.jsx b/src/components/travel-advisory/HistoryModal.jsx new file mode 100644 index 0000000..6449a6a --- /dev/null +++ b/src/components/travel-advisory/HistoryModal.jsx @@ -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/medical issues in this country.
  • ; + } + + return ( +
    +
    +
    +
    +
    +
    +

    {countries}

    +

    {dangerLevel}

    +
    +
    +

    History

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