From 8fbaca0d8ec9dc1323facb7f4c0029e32cfe5223 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 16 Jul 2023 00:38:39 -0400 Subject: Working travel advisor* --- app/travel-advisory/countries.json | 371 ++++++++++++++++++++++++++++++++++++- app/travel-advisory/page.js | 62 +++++-- 2 files changed, 416 insertions(+), 17 deletions(-) diff --git a/app/travel-advisory/countries.json b/app/travel-advisory/countries.json index 3fb16d8..7d031c1 100644 --- a/app/travel-advisory/countries.json +++ b/app/travel-advisory/countries.json @@ -3,41 +3,103 @@ { "name": "Anatoli", "status": 0, + "image": "", + "settlements": [ + { + "name": "Anatoli City", + "status": 0 + }, + { + "name": "Wairua", + "status": 0 + }, + { + "name": "Vremya", + "status": 0 + } + ], "history": [] }, { "name": "Auckland", "status": 0, + "image": "", + "settlements": [ + { + "name": "Settlement 1", + "status": 0 + } + ], "history": [] }, { "name": "Aura Regions, The", "status": 0, + "image": "", + "settlements": [ + { + "name": "Baxford", + "status": 0 + }, + { + "name": "Energy Cove", + "status": 0 + }, + { + "name": "Motley Island", + "status": 0 + }, + { + "name": "Treasure Island", + "status": 0 + } + + ], "history": [] }, { "name": "Birch Boat Town", "status": 0, + "image": "", + "settlements": [], "history": [] }, { "name": "Birch Lodges Community Town", "status": 0, + "image": "", + "settlements": [], "history": [] }, { "name": "Country Warp", "status": 0, + "image": "", + "settlements": [ + { + "name": "Settlement 1", + "status": 0 + } + ], "history": [] }, { "name": "Eagle City", "status": 0, + "image": "", + "settlements": [], "history": [] }, { "name": "Fegal", "status": 3, + "image": "", + "settlements": [ + { + "name": "Settlement 1", + "status": 0 + } + ], "history": [ "May 17th 2023: Fegal has border security issues and it has not been solved as of now." ] @@ -45,16 +107,80 @@ { "name": "Halcandra", "status": 0, + "image": "", + "settlements": [ + { + "name": "Settlement 1", + "status": 0 + } + ], "history": [] }, { "name": "Inkytown", "status": 0, + "image": "", + "settlements": [], "history": [] }, { "name": "Kemonomimi Republic, The", "status": 1, + "image": "", + "settlements": [ + { + "name": "Melanie City", + "status": 0 + }, + { + "name": "Shishiro", + "status": 0 + }, + { + "name": "Koinu", + "status": 0 + }, + { + "name": "Akiyama", + "status": 0 + }, + { + "name": "Elysia", + "status": 0 + }, + { + "name": "Sakamoto", + "status": 0 + }, + { + "name": "Tsumugi", + "status": 0 + }, + { + "name": "Inugake", + "status": 0 + }, + { + "name": "Amatsuka", + "status": 0 + }, + { + "name": "Calliope", + "status": 0 + }, + { + "name": "Rocco Town", + "status": 0 + }, + { + "name": "Imari", + "status": 0 + }, + { + "name": "Kessoku Island", + "status": 0 + } + ], "history": [ "July 15: KR has internal power issues between the President and Govenor. Governor was trying to form a new government under \"KSSR\"." ] @@ -62,85 +188,322 @@ { "name": "Knowle Regions, The", "status": 0, + "image": "", + "settlements": [ + { + "name": "Settlement 1", + "status": 0 + } + ], "history": [] }, { "name": "Lion Land", "status": 0, + "image": "", + "settlements": [ + { + "name": "Settlement 1", + "status": 0 + } + ], "history": [] }, { "name": "Mart's Extraordinarily Sublime State", "status": 0, + "image": "", + "settlements": [ + { + "name": "Settlement 1", + "status": 0 + } + ], "history": [] }, { "name": "Mojave", "status": 0, + "image": "", + "settlements": [ + { + "name": "Hebrith", + "status": 0 + }, + { + "name": "Symbelton", + "status": 0 + }, + { + "name": "Wetlands", + "status": 0 + } + ], "history": [] }, { "name": "Open Republic, The", "status": 0, + "image": "", + "settlements": [ + { + "name": "New Clygro Town", + "status": 0 + }, + { + "name": "New Clygro City", + "status": 0 + }, + { + "name": "New Clygro Town Industrial Estate", + "status": 0 + }, + { + "name": "Westvalley", + "status": 0 + }, + { + "name": "North Coastal Town", + "status": 0 + }, + { + "name": "Old Village", + "status": 0 + }, + { + "name": "Red Island City", + "status": 0 + }, + { + "name": "Pink Island", + "status": 0 + }, + { + "name": "Blue Island", + "status": 0 + }, + { + "name": "Purple Island", + "status": 0 + }, + { + "name": "Yellowtown", + "status": 0 + }, + { + "name": "Delancy", + "status": 0 + }, + { + "name": "Bordertown", + "status": 0 + }, + { + "name": "Small Village", + "status": 0 + }, + { + "name": "Murmur Town", + "status": 0 + } + ], "history": [] }, { "name": "PLC", "status": 0, + "image": "", + "settlements": [ + { + "name": "Settlement 1", + "status": 0 + } + ], "history": [] }, { "name": "Plutonia Imperium", "status": 0, + "image": "", + "settlements": [ + { + "name": "Settlement 1", + "status": 0 + } + ], "history": [] }, { "name": "Solstice, The Federal Democracy of", "status": 0, + "image": "", + "settlements": [ + { + "name": "Firefly", + "status": 0 + }, + { + "name": "Szki Lanes", + "status": 0 + }, + { + "name": "Prehevil", + "status": 0 + } + ], "history": [] }, { "name": "Southeastern Islands, The", "status": 2, + "image": "", + "settlements": [ + { + "name": "Swamp Island", + "status": 0 + }, + { + "name": "Forêt Québec", + "status": 3 + }, + { + "name": "Longhorn Hills", + "status": 0 + }, + { + "name": "Nexus Underground", + "status": 0 + } + ], "history": [ - "July 15: A disease has been going around Foret Quebec", - "Foret Quebec has been dealing with environmental issues" + "July 15: A disease has been going around Forêt Québec, we have decided to put border control in the exit of Alure Regions to SEI" ] }, { "name": "Sulópolis", "status": 0, + "image": "", + "settlements": [ + { + "name": "Settlement 1", + "status": 0 + } + ], "history": [] }, - { + { "name": "TAY", "status": 0, + "image": "", + "settlements": [ + { + "name": "Victor's Interesting City", + "status": 0 + }, + { + "name": "Rogueport", + "status": 0 + }, + { + "name": "Seven Eleven Rainforest", + "status": 0 + }, + { + "name": "Palinode", + "status": 0 + }, + { + "name": "Midcity", + "status": 0 + }, + { + "name": "Scion of Linda", + "status": 0 + }, + { + "name": "Jeremy Forest", + "status": 0 + }, + { + "name": "The Eternal Canteloupe", + "status": 0 + }, + { + "name": "September Sands", + "status": 0 + }, + { + "name": "Belindan Slopes", + "status": 0 + }, + { + "name": "Turing Town", + "status": 0 + }, + { + "name": "Bell Tower", + "status": 0 + }, + { + "name": "Szloch-by-sea", + "status": 0 + } + ], "history": [] }, { "name": "Union of Soviet Sovereign Republics", "status": 0, + "image": "", + "settlements": [ + { + "name": "Settlement 1", + "status": 0 + } + ], "history": [] }, { "name": "Veronian Controlled Territories", "status": 0, + "image": "", + "settlements": [ + { + "name": "Settlement 1", + "status": 0 + } + ], "history": [] }, { "name": "Whale City, The Republic of", "status": 0, + "image": "", + "settlements": [], "history": [] }, { "name": "Yavno, The Federation of", "status": 0, + "settlements": [ + { + "name": "Settlement 1", + "status": 0 + } + ], "history": [] }, { "name": "You on Kazoo, The Republic of", "status": 0, + "image": "", + "settlements": [ + { + "name": "Settlement 1", + "status": 0 + } + ], "history": [] } ] -} \ No newline at end of file +} diff --git a/app/travel-advisory/page.js b/app/travel-advisory/page.js index 5db351c..f1442aa 100644 --- a/app/travel-advisory/page.js +++ b/app/travel-advisory/page.js @@ -1,4 +1,4 @@ -import { readFileSync } from "fs"; +import countriesData from './countries.json' assert { type: 'json' }; export const metadata = { title: 'Travel Advisory', @@ -6,12 +6,53 @@ export const metadata = { } export async function getCountries(){ - const files = readdirSync('./countries.json'); + const countries = countriesData.countries; + return countries.map((country) => { + let dangerLevel; + switch (country.status) { + case 0: + dangerLevel = "Take normal security precautions" + break; + case 1: + dangerLevel = "Exercise a high degree of caution" + break; + case 2: + dangerLevel = "Avoid non-essential travel" + break; + case 3: + dangerLevel = "Avoid all travel" + break; + } + return ( +
+
+

{country.name}

+

{dangerLevel}

+
+ + +
+

City 1

+

Take normal security precautions

+

City 2

+

Take normal security precautions

+

City 3

+

Take normal security precautions

+

City 4

+

Take normal security precautions

+
+
+
+
+ ) + }) } export default async function TravelAdvisory(){ + const countries = await getCountries(); return (
@@ -43,21 +84,16 @@ export default async function TravelAdvisory(){

This page may be inaccurate at times, refer to the Minecraft General Announcements channel for the latest updates

-
-
+ { /*
+

Country name

Take normal security precautions

-

City 1

-

Take normal security precautions

-

City 2

-

Take normal security precautions

-

City 3

-

Take normal security precautions

-

City 4

-

Take normal security precautions

+
+
-
+
*/ } + {countries}
) } -- cgit v1.2.3