use axum::{
    response::IntoResponse,
    routing::{get, Router},
};

use super::templates::{
    ArchServerTemplate, 
    BooksTemplate, 
    EdgeDetectionTemplate, 
    GardenTemplate, 
    HtmlTemplate,
    TakTemplate,
};

pub fn get_router() -> Router {
    Router::new()
        .route("/", get(garden))
        .route("/ed", get(edge_detection))
        .route("/books", get(books))
        .route("/tak", get(tak))
        .route("/archserver", get(arch_server))
}

async fn garden() -> impl IntoResponse {
    let garden_page = GardenTemplate {};
    HtmlTemplate(garden_page)
}

async fn edge_detection() -> impl IntoResponse {
    let edge_detection_page = EdgeDetectionTemplate {};
    HtmlTemplate(edge_detection_page)
}

async fn books() -> impl IntoResponse {
    let books_page = BooksTemplate {};
    HtmlTemplate(books_page)
}

async fn tak() -> impl IntoResponse {
    let tak_page = TakTemplate {};
    HtmlTemplate(tak_page)
}

async fn arch_server() -> impl IntoResponse {
    let arch_server_page = ArchServerTemplate {};
    HtmlTemplate(arch_server_page)
}
