import { Component, Input, OnInit } from "@angular/core";
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
import { IconDefinition } from "@fortawesome/fontawesome-svg-core";

import { Testimonials } from "../config/Testimonials";

/**
 *
 */
@Component({
  selector: "app-review",
  standalone: true,
  imports: [FontAwesomeModule],
  templateUrl: "./review.component.html",
  styleUrl: "./review.component.css"
})
export class ReviewComponent implements OnInit {
  @Input() review: (typeof Testimonials)[number] = {} as never;
  @Input() even = false;
  public name = "";
  public content = "";
  public sourceIcon: IconDefinition = {} as never;
  public sourceUrl = "";
  public class = "review";

  /**
   *
   */
  ngOnInit(): void {
    this.name = this.review.name;
    this.content = this.review.content;
    this.sourceIcon = this.review.sourceIcon;
    this.sourceUrl = this.review.sourceUrl;
    this.class = this.even ? "review green" : "review";
  }
}
