use crate::state::app::state::AppState;
use crate::state::pages::admin::AdminState;

pub fn handle_admin_selection(app_state: &mut AppState, admin_state: &AdminState) {
    let profiles = &app_state.profile_tree.profiles;
    if let Some(selected_index) = admin_state.get_selected_index() {
        if let Some(profile) = profiles.get(selected_index) {
            app_state.selected_profile = Some(profile.name.clone());
        }
    }
}
