import React, { useEffect, useState } from 'react'; import { getPets } from '../../api/petfinder'; import Hero from '../../components/hero'; // import useParams // import Link const HomePage = () => { const [data, setData] = useState(null); const type = ''; // Fix me! useEffect(() => { async function getPetsData() { const petsData = await getPets(type); setData(petsData); } getPetsData(); }, [type]); if (!data) { return

Loading...

; } return (

{type ? `${type}s` : 'Pets'}{' '} available for adoption near you

{data.length ? (
{data.map((animal) => (
{ }

{animal.name}

Breed: {animal.breeds.primary}

Color: {animal.colors.primary}

Gender: {animal.gender}

// Don't forget to change me! ))}
) : (

No {type}s available for adoption now.

)}
); }; export default HomePage;