diff --git a/src/pages/Home.jsx b/src/pages/Home.jsx index ff3ab95..a0308e7 100644 --- a/src/pages/Home.jsx +++ b/src/pages/Home.jsx @@ -1,6 +1,15 @@ import React, { useState, useEffect } from "react"; import { Loader, Card, FormField } from "../components"; +const RenderCards = ({ data, title }) => { + if (data?.length > 0) { + return data.map((post) => ); + } + return ( +

{title}

+ ); +}; + const Home = () => { const [loading, setLoading] = useState(false); const [allPosts, setAllPosts] = useState(null); @@ -35,6 +44,13 @@ const Home = () => { {searchText} )} +
+ {searchText ? ( + + ) : ( + + )} +
)}