import { CommonModule } from '@angular/common';
import { Component, Input, OnInit, Output } from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';
import { Player } from 'src/app/model';

@Component({
  selector: 'app-player-card',
  templateUrl: './player-card.component.html',
  styleUrls: ['./player-card.component.scss'],
  standalone: true,
  imports: [CommonModule, TranslateModule]
})
export class PlayerCardComponent implements OnInit {
  
  @Input() player!: Player;


  ngOnInit(): void {}


  get playerInitials(): string {
    if (!this.player) { return ' '; }

    return this.player.firstName.substring(0, 1) + this.player.lastName.substring(0, 1);
  }

}
