1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2025-01-07 17:17:40 +01:00
smov/src/setup/App.tsx
2023-01-08 13:15:32 +01:00

30 lines
1.1 KiB
TypeScript

import { Redirect, Route, Switch } from "react-router-dom";
import { MWMediaType } from "@/providers";
import { BookmarkContextProvider } from "@/state/bookmark";
import { WatchedContextProvider } from "@/state/watched";
import { NotFoundPage } from "@/views/notfound/NotFoundView";
import { MediaView } from "@/views/MediaView";
import { SearchView } from "@/views/search/SearchView";
import { TestView } from "@/views/TestView";
function App() {
return (
<WatchedContextProvider>
<BookmarkContextProvider>
<Switch>
<Route exact path="/">
<Redirect to={`/search/${MWMediaType.MOVIE}`} />
</Route>
<Route exact path="/media/movie/:media" component={MediaView} />
<Route exact path="/media/series/:media" component={MediaView} />
<Route exact path="/search/:type/:query?" component={SearchView} />
<Route exact path="/test" component={TestView} />
<Route path="*" component={NotFoundPage} />
</Switch>
</BookmarkContextProvider>
</WatchedContextProvider>
);
}
export default App;