Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
783 B
2
Indexable
Never
import React from "react";
import {
    BrowserRouter as Router,
    Routes,
    Route,
    Outlet
} from "react-router-dom";
import Trending from "./trending";
import Header from "./header";
import Detail from "./detail";

export default function Root() { 
    return (
        <Router>
            <div id="topbar">
                <Header />
            </div>
            <Routes>
                {/* Chemin pour Trending */}
                <Route path="/" element={<Trending />} />

                {/* Chemin pour Detail avec paramètre movieId */}
                <Route path="details/:movieId" element={<Detail />} />

                {/* Autres routes si nécessaire */}
            </Routes>
            <Outlet />
        </Router>
    );
}
Leave a Comment