'use client'; | |
import { createContext, useState, useContext } from 'react'; | |
const FilmContext = createContext(); | |
export const useFilmContext = () => useContext(FilmContext); | |
export const FilmProvider = ({ children }) => { | |
const [films, setFilms] = useState([]); | |
return ( | |
<FilmContext.Provider value={{ films, setFilms }}> | |
{children} | |
</FilmContext.Provider> | |
); | |
}; | |