diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2023-07-24 20:27:10 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2023-07-24 20:27:10 -0400 |
| commit | 649b1d4328a7ffc31cb5e9d47e2b3ddefcc66f16 (patch) | |
| tree | cec8bf0658a8555c418b3ffeef57332097d84ee5 /src/components/travel-advisory/HistoryModal.jsx | |
| parent | a04ae661c547e7e051927e7a169aeb492f50a532 (diff) | |
| download | alure-website-649b1d4328a7ffc31cb5e9d47e2b3ddefcc66f16.tar.gz alure-website-649b1d4328a7ffc31cb5e9d47e2b3ddefcc66f16.tar.bz2 alure-website-649b1d4328a7ffc31cb5e9d47e2b3ddefcc66f16.zip | |
Initial rewrite to astro
Diffstat (limited to 'src/components/travel-advisory/HistoryModal.jsx')
| -rw-r--r-- | src/components/travel-advisory/HistoryModal.jsx | 40 |
1 files changed, 40 insertions, 0 deletions
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 ( + <li key={index}>{event}</li> + ) + }) + } else { + historyList = <li>Currently no diplomatic/medical issues in this country.</li>; + } + + return ( + <div id="wrapper" className="fixed inset-0 bg bg-opacity-25 backdrop-blur-sm flex justify-center items-center" onClick={handleClose}> + <div className="w-[700px]"> + <div className="flex flex-col"> + <div className="bg-zinc-800 p-5 rounded-lg border border-gray-700"> + <div className="divide-y space-y-3"> + <div> + <h1 className="font-medium text-3xl">{countries}</h1> + <h2 className="font-medium text-xl">{dangerLevel}</h2> + </div> + <div> + <h1 className="font-medium text-2xl pt-3">History</h1> + <ul>{historyList}</ul> + </div> + </div> + </div> + </div> + </div> + </div> + ) +} + +export default HistoryModal; |
