diff --git a/src/App.tsx b/src/App.tsx index 355fbec..11b0b82 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -9,10 +9,22 @@ function App() { type countryInfoT = { capital: string; languages: object; + flags: { + svg: string; + }; + name: { + official: string; + }; }; const [countryInfo, setCountryInfo] = useState({ capital: "", languages: {}, + flags: { + svg: "", + }, + name: { + official: "", + }, }); useEffect(() => { @@ -51,17 +63,23 @@ function App() { } return ( <> -

{country}

-
-

- Capital: {countryInfo?.capital} -

-

- Languages:{" "} - {Object.values(countryInfo?.languages).map((l) => l + ", ")} -

-
+ {countryInfo && ( +
+

{country}

+

+ Official name: {countryInfo.name.official} +

+

+ Capital: {countryInfo?.capital} +

+

+ Languages:{" "} + {Object.values(countryInfo?.languages).map((l) => l + ", ")} +

+ +
+ )} ); }