import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { TranslatePipe } from '../../../../../../i18n/translate.pipe';

@Component({
  selector: 'app-stars',
  standalone: true,
  imports: [TranslatePipe],
  templateUrl: './stars.component.html',
  styleUrls: ['./stars.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class StarsComponent {
  @Input() rating = 0;
  @Input() max = 5;
  @Input() size: 'sm' | 'md' | 'lg' = 'md';

  get stars(): number[] {
    return Array.from({ length: this.max }, (_, index) => index + 1);
  }
}
