Added basic song page structure and corresponding css file

This commit is contained in:
Daniel Miller 2024-12-11 04:23:24 +00:00
parent 7f58c4b68b
commit b4bc605943
2 changed files with 32 additions and 0 deletions

32
src/pages/songpage.rs Normal file
View File

@ -0,0 +1,32 @@
#[component]
pub fn SongPage() -> impl IntoView {
let params = use_params_map();
view! {
<div class="song-container home-component">
{move || params.with(|params| {
match params.get("id").map(|id| id.parse::<i32>()) {
Some(Ok(id)) => {
view! { <SongDetails id /> }.into_view()
},
Some(Err(e)) => {
view! {
<Error<String>
title="Invalid Song ID"
error=e.to_string()
/>
}.into_view()
},
None => {
view! {
<Error<String>
title="No Song ID"
message="You must specify a song ID to view its page."
/>
}.into_view()
}
}
})}
</div>
}
}

0
style/song.scss Normal file
View File