diff --git a/src/app.rs b/src/app.rs
index 67a6c7a..ed9fd1b 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -1,4 +1,5 @@
use crate::playbar::PlayBar;
+use crate::playbar::CustomTitle;
use crate::playstatus::PlayStatus;
use crate::queue::Queue;
use leptos::*;
@@ -24,7 +25,7 @@ pub fn App() -> impl IntoView {
// sets the document title
-
+
// content for this welcome page
) -> impl IntoView {
}
}
+/// Renders the title of the page based on the currently playing song
+#[component]
+pub fn CustomTitle(play_status: RwSignal) -> impl IntoView {
+ let title = create_memo(move |_| {
+ play_status.with(|play_status| {
+ play_status.queue.front().map_or("LibreTunes".to_string(), |song_data| {
+ format!("{} - {} | {}",song_data.title.clone(),Artist::display_list(&song_data.artists), "LibreTunes")
+ })
+ })
+ });
+ view! {
+
+ }
+}
+
/// The main play bar component, containing the progress bar, media info, play controls, and play duration
#[component]
pub fn PlayBar(status: RwSignal) -> impl IntoView {