import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { LoaderType } from '@msfa-enums/loader-type.enum';

@Component({
  selector: 'msfa-loader',
  templateUrl: './loader.component.html',
  styleUrls: ['./loader.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class LoaderComponent {
  private readonly _defaultClass = 'loader';
  @Input() type: LoaderType;

  get classes(): string {
    if (this.type) {
      return `${this._defaultClass} ${this._defaultClass}--${this.type as string}`;
    }
    return this._defaultClass;
  }
}
