import { Component, Input, ChangeDetectionStrategy } from '@angular/core';

/**
 * Composant de spinner de chargement réutilisable
 */
@Component({
  selector: 'app-loading-spinner',
  template: `
    <div class="loading-container" [class.overlay]="overlay">
      <mat-spinner 
        [diameter]="diameter" 
        [strokeWidth]="strokeWidth"
        [color]="color">
      </mat-spinner>
      <p class="loading-message" *ngIf="message">{{ message }}</p>
    </div>
  `,
  styleUrls: ['./loading-spinner.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class LoadingSpinnerComponent {
  @Input() diameter: number = 40;
  @Input() strokeWidth: number = 4;
  @Input() color: 'primary' | 'accent' | 'warn' = 'primary';
  @Input() message: string = '';
  @Input() overlay: boolean = false;
}

