mini-player: wip
This commit is contained in:
parent
c4c49dee6b
commit
8b0de4bf93
13 changed files with 217 additions and 3 deletions
24
src/templates/miniplayer.rs
Normal file
24
src/templates/miniplayer.rs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use askama::Template;
|
||||
use axum::{
|
||||
extract::State,
|
||||
response::{Html, IntoResponse},
|
||||
};
|
||||
|
||||
use crate::domain::{AppState, Track};
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "partials/miniplayer.html")]
|
||||
struct MiniPlayerTemplate {
|
||||
tracks: Vec<Track>,
|
||||
}
|
||||
pub async fn miniplayer(State(state): State<Arc<AppState>>) -> impl IntoResponse {
|
||||
Html(
|
||||
MiniPlayerTemplate {
|
||||
tracks: state.mp_tracks.clone(),
|
||||
}
|
||||
.render()
|
||||
.unwrap(),
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue