//! Player management handlers

use axum::{
    extract::{State, Path},
    response::Html,
    http::StatusCode,
};
use sqlx::SqlitePool;

#[derive(Clone)]
pub struct AppState {
    pub pool: SqlitePool,
}

pub async fn list_players_handler(State(_state): State<AppState>) -> Html<String> {
    Html("<h1>Players List</h1>".to_string())
}

pub async fn player_profile_handler(
    State(_state): State<AppState>,
    Path(_player_id): Path<i64>,
) -> Result<Html<String>, (StatusCode, String)> {
    Ok(Html("<h1>Player Profile</h1>".to_string()))
}

pub async fn new_player_handler() -> Html<String> {
    Html("<h1>New Player Form</h1>".to_string())
}

pub async fn create_player_handler() -> Html<String> {
    Html("<h1>Player Created</h1>".to_string())
}

pub async fn edit_player_handler(
    State(_state): State<AppState>,
    Path(_player_id): Path<i64>,
) -> Result<Html<String>, (StatusCode, String)> {
    Ok(Html("<h1>Edit Player</h1>".to_string()))
}

pub async fn update_player_handler(
    State(_state): State<AppState>,
    Path(_player_id): Path<i64>,
) -> Result<Html<String>, (StatusCode, String)> {
    Ok(Html("<h1>Player Updated</h1>".to_string()))
}
