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 --- app/travel-advisory/page.js | 70 ++++----------------------------------------- 1 file changed, 5 insertions(+), 65 deletions(-) (limited to 'app/travel-advisory/page.js') diff --git a/app/travel-advisory/page.js b/app/travel-advisory/page.js index f1442aa..b4d845f 100644 --- a/app/travel-advisory/page.js +++ b/app/travel-advisory/page.js @@ -1,66 +1,15 @@ -import countriesData from './countries.json' assert { type: 'json' }; +import ListCountries from "@/components/travel-advisory/ListCountries"; +import Header from "@/components/Header"; export const metadata = { title: 'Travel Advisory', description: 'Information whether its safe to travel to other countries', } -export async function getCountries(){ - 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 (
-
-
-

{metadata.title}

-

{metadata.description}

-
-
+

Legend

    @@ -83,17 +32,8 @@ 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

-
- -
-
-
*/ } - {countries} +

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

+
) } -- cgit v1.2.3