Devendra174's picture
Upload folder using huggingface_hub
f5071ca verified
raw
history blame contribute delete
468 Bytes
import React from "react";
import { useNavigate } from "react-router-dom";
import useUpdateWatchedMovies from "./useUpdateWatchedMovies";
function usePlayMovie() {
const { addToWatchedMovies } = useUpdateWatchedMovies();
const navigate = useNavigate();
const playMovie = (movie, from) => {
addToWatchedMovies(movie);
navigate(`/play/${movie.id}`, { replace: true, state: { From: from } });
};
return { playMovie };
}
export default usePlayMovie;