use actix_session::Session;
use actix_web::{web, HttpRequest, HttpResponse};
use dbui_service::AppConfig;
pub fn testbed_key(session: Session, cfg: web::Data<AppConfig>, key: web::Path<String>, req: HttpRequest) -> HttpResponse {
crate::act(&session, &cfg, req, |ctx, router| {
let k: &str = &key;
match k {
"dump" => dbui_templates::testbed::dump(&ctx, router),
"gallery" => dbui_templates::testbed::gallery(&ctx, router),
"prototype" => dbui_templates::testbed::prototype(&ctx, router),
"scroll" => dbui_templates::testbed::scroll(&ctx, router),
_ => Err(anyhow::anyhow!("Cannot find testbed matching [{}]", key))
}
})
}