2021-07-13 22:31:37 +00:00
|
|
|
import { SearchView } from './views/Search';
|
|
|
|
import { MovieView } from './views/Movie';
|
2021-08-07 18:42:56 +00:00
|
|
|
import { useMovie, MovieProvider } from './hooks/useMovie';
|
|
|
|
import './index.css';
|
2021-07-13 22:31:37 +00:00
|
|
|
|
|
|
|
function Router() {
|
2021-08-02 12:15:18 +00:00
|
|
|
const { streamData } = useMovie();
|
2021-10-22 21:30:54 +00:00
|
|
|
return streamData ? <MovieView /> : <SearchView />;
|
2021-07-13 22:31:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function App() {
|
|
|
|
return (
|
|
|
|
<MovieProvider>
|
2021-10-22 21:30:54 +00:00
|
|
|
<Router />
|
2021-07-13 22:31:37 +00:00
|
|
|
</MovieProvider>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|