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

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

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

async fn projects() -> impl IntoResponse {
    let projects_page = ProjectsTemplate {};
    HtmlTemplate(projects_page)
}

async fn edge_detection() -> impl IntoResponse {
    let edge_detection_page = EdgeDetectionTemplate {};
    HtmlTemplate(edge_detection_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)
}
