diff --git a/src/components/song_list.rs b/src/components/song_list.rs index 2ace92a..e0c46d7 100644 --- a/src/components/song_list.rs +++ b/src/components/song_list.rs @@ -18,8 +18,10 @@ pub fn SongList(songs: MaybeSignal>) -> impl IntoView { let playing = first_song.into(); first_song = false; + let extra = Option::<()>::None; + view! { - + } }).collect::>() }) @@ -29,7 +31,33 @@ pub fn SongList(songs: MaybeSignal>) -> impl IntoView { } #[component] -pub fn SongListItem(song: SongData, song_playing: MaybeSignal) -> impl IntoView { +pub fn SongListExtra(songs: MaybeSignal>) -> impl IntoView where + T: Clone + IntoView + 'static +{ + view! { + + { + songs.with(|songs| { + let mut first_song = true; + + songs.iter().map(|(song, extra)| { + let playing = first_song.into(); + first_song = false; + + view! { + + } + }).collect::>() + }) + } +
+ } +} + +#[component] +pub fn SongListItem(song: SongData, song_playing: MaybeSignal, extra: Option) -> impl IntoView where + T: IntoView + 'static +{ let liked = create_rw_signal(song.like_dislike.map(|(liked, _)| liked).unwrap_or(false)); let disliked = create_rw_signal(song.like_dislike.map(|(_, disliked)| disliked).unwrap_or(false)); @@ -44,6 +72,10 @@ pub fn SongListItem(song: SongData, song_playing: MaybeSignal) -> impl Int {format!("{}:{:02}", song.duration / 60, song.duration % 60)} + {extra.map(|extra| view! { + + {extra} + })} } }