Undo previous commit, pushed to wrong branch
This commit is contained in:
parent
b4bc605943
commit
e53f74c0f3
@ -1,32 +0,0 @@
|
|||||||
#[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>
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user