// src/lib/types/match.ts
import type { Map, User, RealtimeScore, Push_SongFinished } from 'moons-ta-client';
import type { BeatSaverMap } from '$lib/services/beatsaver.js';

export interface CustomMap {
    taData: Map;
    beatsaverData: BeatSaverMap;
}

export interface RealTimeScoreForPlayers {
    player: User;
    recentScore: RealtimeScore;
}

export interface PreviousResults {
    taData: Map;
    beatsaverData: BeatSaverMap;
    scores: Push_SongFinished[];
    completionType: 'Completed' | 'Still Awaiting Scores' | 'Exited To Menu';
}

export enum MapDifficulty {
    "Easy" = 0,
    "Normal" = 1,
    "Hard" = 2,
    "Expert" = 3,
    "ExpertPlus" = 4,
}

export const colorPresets = {
    primary: 'var(--accent-glow)',
    secondary: 'var(--text-secondary)',
    success: '#4CAF50',
    warning: '#FFC107',
    error: '#F44336',
    info: '#2196F3',
    default: 'var(--text-primary)'
} as const;

export type ColorPreset = keyof typeof colorPresets;
export type ButtonType = 'primary' | 'secondary' | 'text' | 'outlined';

export interface ButtonConfig {
    text: string;
    type: ButtonType;
    href?: string;
    color?: ColorPreset;
    icon?: string;
    action?: () => void;
}

export interface CustomTAMapPool {
    guid: string;
    name: string;
    image: string;
    maps: CustomMap[];
}