mini-player: wip

This commit is contained in:
Agahnim 2026-03-19 19:17:53 +01:00
parent c4c49dee6b
commit 8b0de4bf93
13 changed files with 217 additions and 3 deletions

View 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(),
)
}

View file

@ -1,2 +1,3 @@
pub mod index;
pub mod miniplayer;
pub mod notfound;