export type LeaderboardEntry = {
  username: string
  highscore: number
  grade: string
}

export type LeaderboardHighlight = {
  username: string
  score: number
}

export type LeaderboardState = {
  rows: LeaderboardEntry[]
  loading: boolean
  fetchError: string | null
  highlight: LeaderboardHighlight | null
}

export type LeaderboardActions = {
  setRows: (rows: LeaderboardEntry[]) => void
  setLoading: (loading: boolean) => void
  setFetchError: (error: string | null) => void
  setHighlight: (highlight: LeaderboardHighlight | null) => void
  reset: () => void
}

export type LeaderboardStore = LeaderboardState & LeaderboardActions
