mirror of
https://github.com/p-stream/p-stream.git
synced 2026-03-25 07:08:23 +00:00
27 lines
615 B
JavaScript
27 lines
615 B
JavaScript
import { SearchView } from './views/Search';
|
|
import { MovieView } from './views/Movie';
|
|
import { useMovie, MovieProvider } from './hooks/useMovie';
|
|
import './index.css';
|
|
import {store} from './lib/storage/watched.js'
|
|
|
|
function Router() {
|
|
const { streamData } = useMovie();
|
|
return streamData ? <MovieView /> : <SearchView />;
|
|
}
|
|
|
|
function App() {
|
|
return (
|
|
<MovieProvider>
|
|
<div>
|
|
<p>Testing</p>
|
|
<button onClick={() => {
|
|
const data = store.get();
|
|
data.save();
|
|
}}>Click me</button>
|
|
</div>
|
|
<Router />
|
|
</MovieProvider>
|
|
);
|
|
}
|
|
|
|
export default App;
|