import { Component, OnInit } from '@angular/core';
import {BreakpointObserver, Breakpoints} from '@angular/cdk/layout';
import {Router} from "@angular/router";
import { TranslationService } from '../../services/translation.service';

@Component({
  selector: 'app-header',
  templateUrl: './header.component.html',
  styleUrls: ['./header.component.scss']
})
export class HeaderComponent implements OnInit {
  title!: string;
  version!: string;
  sandkasten_logo!: string;
  gitea_logo!: string;

  ngOnInit(): void {
    this.title = 'Sandkasten';
    this.version = '1.0';
    this.sandkasten_logo = 'assets/img/logo.png';
    this.gitea_logo = 'assets/img/gitea.png';
  }

  // Instanciation du service pour les actions de traduction
  constructor(private translationService: TranslationService) {}

  // Méthode pour changer la langue
  onLanguageChange(event: any) {
    this.translationService.onLanguageChange(event);
  }

  // Méthode pour récupérer le drapeau de la langue courante
  getFlagImageUrl(): string {
    return this.translationService.getFlagImageUrl();
  }
}