24 lines
497 B
Rust
24 lines
497 B
Rust
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(),
|
|
)
|
|
}
|