use axum::Json;
use axum::extract::State;
use axum::response::IntoResponse;
use serde_json::json;
use crate::state::AppState;
pub async fn renderer_breakers(State(state): State<AppState>) -> impl IntoResponse {
Json(state.renderer.breakers().snapshot())
}
pub async fn reset_breakers(State(state): State<AppState>) -> impl IntoResponse {
let cleared = state.renderer.breakers().reset_all();
tracing::warn!(cleared, "admin: all renderer breakers reset");
Json(json!({ "ok": true, "host_entries_cleared": cleared }))
}