For now, we have simply displayed the list of songs within the Home view, but this isn't great. We should actually create a dedicated component to do that. What we actually want is a component that we can pass the list of songs to, which will render it nicely and let us know when a selection has been made in that list.
Here are the specifications for the SongsList component:
- Accept an array of Song objects as input.
- Accept a loading state boolean as input (which will be used to render the loading indicator when needed).
- Display the provided list of songs; each item should be clickable.
- Emit an event whenever a song in the list has been clicked upon; attach the corresponding Song object to the event.
In the Home view, we will later implement an event handler for the song selection event.
Create the component file, src/components...