Build a component that displays files and directories in a hierarchical tree format.
Requirements:
- Display names of files and directories.
- Directories:
- Can contain other directories and files.
- Should be expandable and collapsible by clicking on them.
- Should be displayed before files and sorted alphabetically.
- Can be empty.
- Files:
- Are leaf nodes, cannot be expanded or interacted with.
- Indent contents to visually represent hierarchy.
- Focus on functionality over styling.
- The component should work out-of-the-box in a live React preview (e.g., CodeSandbox/Sandpack).