import { apiFetch } from "./auth";

export interface OnlinePlayer {
  name: string;
  uuid?: string;
  ping?: number;
}

export interface PlayerListResponse {
  online: OnlinePlayer[];
  maxPlayers: number;
  whitelistCount: number;
}

export async function getPlayers(serverId: string): Promise<PlayerListResponse> {
  return apiFetch<PlayerListResponse>(`/servers/${serverId}/players`);
}
