use axum::http::header;
use axum::response::{Html, IntoResponse as _, Response};
const LIBRARY_HTML: &str = include_str!("../assets/library.html");
const LIBRARY_JS: &str = include_str!("../assets/library.js");
const GROUPS_HTML: &str = include_str!("../assets/groups.html");
const GROUPS_JS: &str = include_str!("../assets/groups.js");
const INVITATIONS_HTML: &str = include_str!("../assets/invitations.html");
const INVITATIONS_JS: &str = include_str!("../assets/invitations.js");
const PROFILE_HTML: &str = include_str!("../assets/profile.html");
const PROFILE_JS: &str = include_str!("../assets/profile.js");
const MODAL_JS: &str = include_str!("../assets/modal.js");
pub async fn library() -> Html<&'static str> {
Html(LIBRARY_HTML)
}
pub async fn groups() -> Html<&'static str> {
Html(GROUPS_HTML)
}
pub async fn invitations() -> Html<&'static str> {
Html(INVITATIONS_HTML)
}
pub async fn profile() -> Html<&'static str> {
Html(PROFILE_HTML)
}
pub async fn library_js() -> Response {
js_response(LIBRARY_JS)
}
pub async fn groups_js() -> Response {
js_response(GROUPS_JS)
}
pub async fn invitations_js() -> Response {
js_response(INVITATIONS_JS)
}
pub async fn profile_js() -> Response {
js_response(PROFILE_JS)
}
pub async fn modal_js() -> Response {
js_response(MODAL_JS)
}
fn js_response(body: &'static str) -> Response {
(
[(
header::CONTENT_TYPE,
"application/javascript; charset=utf-8",
)],
body,
)
.into_response()
}