Hi, I'm working on a small project to learn Next.js. I'm fetching data from a movie API and listing the movies. Users can click on a movie name to be directed to its detail page. My file structure is as follows:
app/
|-- discover/
| |-- newreleases/
| | |-- page.jsx
| |
| |-- trending/
| |-- page.jsx
|
|-- components/
| |-- [movieId].jsx
So the movies listed on both newreleases and trending pages will have the same ui and links should redirect to Movie Detail Page. But it doesnt seem to be working with the current file structure. Although organizing the files like above makes it work, it doesnt make sense since the movieid.jsx is a reusable component.
app/
| |-- discover/
| |-- newreleases/
| |-- [movieId]
| |-- page.jsx
| |-- trending/
| |-- [movieId]
| |-- page.jsx
Can you help me understand how to structure my files to achieve this functionality without sacrificing the reusability of the movieId.jsx component?