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

@Component({
  selector: 'app-accordion',
  templateUrl: './accordion.component.html',
  styleUrls: ['./accordion.component.scss'],
})
export class AccordionComponent implements OnInit {

  @Input("title") title: string;
  accordionExpanded: boolean = false;
  activeColor: string = "ligth";
  icon: string = "add";

  constructor() { }

  ngOnInit() {}

  toogleAction() {
    if (this.accordionExpanded) {
      this.activeColor = "ligth";
      this.icon = "add";
    } else {
      this.activeColor = "primary";
      this.icon = "remove";
    }
    this.accordionExpanded = !this.accordionExpanded;
  }
}
