feat: Refactor event management components and introduce EventModel for better state handling
All checks were successful
SteamWarCI Build successful

This commit is contained in:
2025-06-04 11:33:11 +02:00
parent df389b3acf
commit bd1c4f7f45
9 changed files with 301 additions and 164 deletions

View File

@ -0,0 +1,21 @@
import type { ResponseUser } from "@components/repo/event";
import type { EventFight, ExtendedEvent, ResponseGroups, ResponseRelation, SWEvent } from "@components/types/event";
import type { Team } from "@components/types/team";
export class EventModel {
public event: SWEvent = $state({} as SWEvent);
public teams: Array<Team> = $state([]);
public groups: Array<ResponseGroups> = $state([]);
public fights: Array<EventFight> = $state([]);
public referees: Array<ResponseUser> = $state([]);
public relations: Array<ResponseRelation> = $state([]);
constructor(data: ExtendedEvent) {
this.event = data.event;
this.teams = data.teams;
this.groups = data.groups;
this.fights = data.fights;
this.referees = data.referees;
this.relations = data.relations;
}
}