- To get started, edit the page.tsx file. -
-- Looking for a starting point or more instructions? Head over to{" "} - - Templates - {" "} - or the{" "} - - Learning - {" "} - center. -
-diff --git a/app/components/apitest.tsx b/app/components/apitest.tsx deleted file mode 100644 index 18a54ef..0000000 --- a/app/components/apitest.tsx +++ /dev/null @@ -1,20 +0,0 @@ -// app/Apitest.tsx - -export default async function Apitest() { - // 1. Fetch the data directly in the component - const res = await fetch('https://swapi.py4e.com/api/people/1/'); - const data = await res.json(); - - // 2. This console.log will appear in your TERMINAL, not the browser console - // because this is a Server Component! - console.log("Fetched Pilot:", data.name); - - return ( -
Name: {data.name}
-Height: {data.height}cm
-Mass: {data.mass}kg
-- Looking for a starting point or more instructions? Head over to{" "} - - Templates - {" "} - or the{" "} - - Learning - {" "} - center. -
-+ {displaySubtitle} +
++ {isCombat + ? enemy.manufacturer + : planet?.population.toLocaleString()} +
++ {isCombat ? `${enemy.cost_in_credits} Cr` : planet?.gravity} +
++ {isCombat + ? t.ACTION_PANEL.STATUS.COMBAT_WARNING + : t.ACTION_PANEL.STATUS.PLANET_SCAN} +
++ {t.EVENT_LOG.EMPTY_STATE} +
+ )} + {logs.map((log) => ( +{t.GAME_OVER.SUBTITLE}
+ ++ {t.GAME_OVER.SCORE_LABEL} +
++ {credits.toLocaleString()} Credits +
++ {t.START_SCREEN.SUBTITLE} +
++ {t.START_SCREEN.INTRO_TEXT} + + {" "} + {t.START_SCREEN.MISSION_HIGHLIGHT} + +
++ {t.START_SCREEN.FOOTER_ENGINE} +
+