You are tasked with building a File Selector component for a web application (see screenshot below). This component should allow users to browse and select files from a hierarchical data structure similar to the one provided:
[
{
"name": "src",
"type": "folder",
"children": [
{
"name": "data",
"type": "folder",
"children": [
{
"name": "index.js",
"type": "file"
}
]
},
{
"name": "index.js",
"type": "file"
},
{
"name": "index.css",
"type": "file"
}
]
},
{
"name": "state.ts",
"type": "file"
}
]
- Build a user interface that displays the hierarchical file structure provided above.
- Use icons or visual indicators to differentiate between folders and files.
- Users should be able to expand and collapse folders by clicking on them to view or hide their contents.
- Allow users to select a file by clicking on it and logs the respective file path.
- Implement a breadcrumb navigation bar to show the current path within the file structure.