AlbumData Query, API Endpoint, and Integration into AlbumPage
This commit is contained in:
27
src/components/album_info.rs
Normal file
27
src/components/album_info.rs
Normal file
@ -0,0 +1,27 @@
|
||||
use leptos::leptos_dom::*;
|
||||
use leptos::*;
|
||||
use crate::albumdata::AlbumData;
|
||||
|
||||
#[component]
|
||||
pub fn AlbumInfo(albumdata: AlbumData) -> impl IntoView {
|
||||
view! {
|
||||
<div>
|
||||
<div>
|
||||
<img src={albumdata.image_path} alt="dashboard-tile" />
|
||||
</div>
|
||||
<div>
|
||||
<p>{albumdata.title}</p>
|
||||
<div>
|
||||
{
|
||||
albumdata.artists.iter().map(|artist| {
|
||||
view! {
|
||||
<p>{artist.name.clone()}</p>
|
||||
}
|
||||
}).collect::<Vec<_>>()
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}.into_view()
|
||||
}
|
||||
|
Reference in New Issue
Block a user