Files
swiss-client/src/app/components/court-selection/court-selection.component.ts
Michel ten Voorde 5a5c134002
All checks were successful
Gitea/swiss-client/pipeline/head This commit looks good
Added match counter
2025-08-18 23:28:15 +02:00

55 lines
1.3 KiB
TypeScript

import {Component, inject, Inject} from '@angular/core';
import {
MAT_DIALOG_DATA,
MatDialogActions,
MatDialogClose,
MatDialogContent,
MatDialogRef
} from "@angular/material/dialog";
import {Match} from "../../model/match";
import {MatButton} from "@angular/material/button";
import {TournamentPlayer} from "../../model/tournamentPlayer";
import {MatFormField, MatLabel} from "@angular/material/form-field";
import {MatOption, MatSelect} from "@angular/material/select";
import {FormsModule} from "@angular/forms";
@Component({
selector: 'app-court-selection',
imports: [
MatDialogContent,
MatButton,
MatDialogClose,
MatDialogActions,
MatFormField,
MatLabel,
MatOption,
MatSelect,
FormsModule,
],
templateUrl: './court-selection.component.html',
styleUrl: './court-selection.component.scss'
})
export class CourtSelectionComponent {
court: number;
counter: TournamentPlayer;
readonly dialogRef = inject(MatDialogRef<CourtSelectionComponent>);
constructor(@Inject(MAT_DIALOG_DATA) public data: {
match: Match,
availableCourts: number[],
totalCourts: number,
availableCounters: TournamentPlayer[]
}) {}
onAnnulerenClick() {
this.dialogRef.close();
}
selectCourt(selectedCourt: number) {
this.court = selectedCourt;
}
}