Build a file explorer in React that uses a flat DOM structure (no nested <div>s for children), but still visually represents hierarchy.
Requirements:
- Display files and directories in a list, using a flat DOM structure.
- Directories:
- Can contain files and subdirectories.
- Can be expanded or collapsed by clicking.
- Should be displayed before files and sorted alphabetically.
- Files:
- Are leaf nodes, cannot be expanded.
- Hierarchy must be visually represented by indentation (using styles, not nested DOM).
- Focus on functionality and flat structure, not styling.