import React from 'react'; import { useDispatch } from 'react-redux'; import { useNavigate } from 'react-router-dom'; import { selectGame } from './action'; const Home = () => { const games = ['Cricket', 'Football', 'Tennis']; const dispatch = useDispatch(); const navigate = useNavigate(); const handleBookNow = (game) => { dispatch(selectGame(game)); navigate('/book'); }; return (

Available Games

{games.map((game) => (

{game}

))}
); }; export default Home;