This component is adapted from:

https://www.joshuawootonn.com/react-treeview-component

See the code here for example usage:

https://github.com/joshuawootonn/react-components-from-scratch/blob/main/components/treeview/examples/apple-sidebar.tsx
