import '@inertiajs/svelte';
import type { Config } from 'ziggy-js';

export interface Auth {
    user: User;
}

export interface BreadcrumbItem {
    title: string;
    href: string;
}

export interface NavItem {
    title: string;
    href: string;
    icon?: any;
    isActive?: boolean;
    requireAdmin?: boolean;
}

export type PageProps<T extends Record<string, unknown> = Record<string, unknown>> = T & {
    name: string;
    quote: { message: string; author: string };
    auth: Auth;
    [key: string]: unknown;
    ziggy: Config & { location: string };
};

export interface User {
    id: number;
    name: string;
    email: string;
    avatar?: string;
    email_verified_at: string | null;
    created_at: string;
    updated_at: string;
}

export type BreadcrumbItemType = BreadcrumbItem;

export interface Permission {
    name: string;
    display_name: string;
    description: string;
    is_wildcard: boolean;
}

export enum Status {
    DRAFT = 'draft',
    PUBLIC = 'public',
    PRIVATE = 'private',
}

export interface Tournament {
    id: number;
    name: string;
    description?: string;
    start_date: string;
    status: Status;
    location?: string;
    max_teams: number;
    current_scheduling_mode_id?: number;
    owner: string;
    created_at: string;
    updated_at: string;
    teams: object[];
    fields: object[];
    matches: object[];
    break_periods: object[];
}
