/*
 * Copyright (C) 2018 Robert Bosch GmbH Copyright (C) 2018 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
 */

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

/**
 * @deprecated
 * 
 * This component is deprecated. It will be removed with Web Core 18. Please use the Angular material card instead.
 */
@Component({
  selector: 'bci-tile',
  templateUrl: './tile.component.html',
  styleUrls: ['./tile.component.scss'],
})
export class BciTileComponent {
  @Input() title: string;
  @Input() description: string;
  @Input()
  set iconName(iconName: string) {
    // for backwards compatibility we need to remove Bosch-Ic font class
    this.icon = iconName.replace('Bosch-Ic ', '');
  }
  get iconName(): string {
    return this.icon;
  }
  @Input() detailsButtonLabel: string;
  @Input() addTile = false;
  @Input() actionIconName: string;
  @Input() canExecuteAction: boolean;
  @Output() action: EventEmitter<void> = new EventEmitter();

  private icon: string;

  executeAction($event: Event) {
    $event.stopPropagation();
    $event.preventDefault();
    this.action.emit();
  }
}
