Create a file explorer like Google Drive in React that allows users to browse an arbitrarily nested folder/file hierarchy.
Requirements
-
Define a suitable data model (in JSON) to represent folders and files.
- Each folder can contain children (folders or files).
- Files are leaf nodes.
-
Render the current folder contents as a grid of tiles.
- Folders should be visually distinguishable from files.
- Clicking a folder drills down into that folder.
- Files are only displayed (no further action).
-
Display a breadcrumb trail at the top.
- Clicking “Home” resets to the root folder.
- Clicking an intermediate breadcrumb folder navigates back up to that level.
-
Support unlimited nesting based on the JSON data.
-
Use React state/hooks to manage navigation.
-
Prioritize clean code and UX.
Bonus
- Add a search bar to filter visible files/folders in the current directory.
- Add a “back” button to return to the previously opened folder.
- Add basic icons for folders vs. files.