diff --git a/src/components/Country.jsx b/src/components/Country.jsx
index 177580c..f578a60 100644
--- a/src/components/Country.jsx
+++ b/src/components/Country.jsx
@@ -1,10 +1,27 @@
import React from 'react'
-const Country = () => {
+export const Country = ({name ,flag , population , region , capital}) => {
return (
// TODO: Country component
-
Country
+
+
+
+
+
{name}
+
{population}
+
{region}
+
{capital}
+
+
+
)
}
-export default Country
\ No newline at end of file
+export default Country
+
+
+// "name": "Ă…land Islands",
+// "flag": "https://flagcdn.com/w320/ax.png",
+// "population": 21225,
+// "region": "Europe",
+// "capital": "Mariehamn"
\ No newline at end of file
diff --git a/src/pages/Home.jsx b/src/pages/Home.jsx
index 507e0c5..cd3dc6e 100644
--- a/src/pages/Home.jsx
+++ b/src/pages/Home.jsx
@@ -1,11 +1,36 @@
-import React from "react";
+import React, { useState } from "react";
+import {Country} from "../components/Country"
+import data from '../assets/CountriesData.json'
+
const Home = () => {
+ const [cards, setCards]=useState(data)
+ const onSearch=(e)=>{
+ const newData= data.filter((card)=>card.name.toLowerCase().includes(e.target.value.toLowerCase()));
+ console.log(newData)
+ setCards(newData);
+
+ }
+
return (
- // TODO: Home page
- // Render Country component (components/Country.jsx) for each country
- // Take data from (assets/CountriesData.json)
-