'use client'; | |
import React, { createContext, useContext, useState } from 'react'; | |
const TvShowsContext = createContext(); | |
export const TvShowsProvider = ({ children }) => { | |
const [tvshows, setTvshows] = useState([]); | |
return ( | |
<TvShowsContext.Provider value={{ tvshows, setTvshows }}> | |
{children} | |
</TvShowsContext.Provider> | |
); | |
}; | |
export const useTvShowsContext = () => { | |
return useContext(TvShowsContext); | |
}; |