import { Component, Input, Output, EventEmitter } from '@angular/core';
import { SpaAppChannelI, SpaAppChannelTypeEnum } from '@softpak/ng-components/spa-app-configuration';

@Component({
  selector: 'spa-channel-indicator',
  template: `<div class="bg-white p-3 rounded flex gap-3 items-center text-black">
    <div class="grow">
      <div class="text-lg font-bold">{{ channel?.brand }}</div>
      <div class="text-base text-gray-600">{{ channelType }}</div>
    </div>
    <spn-button (click)="onChange()" [spfType]="'button'">{{ txtChange }}</spn-button>
  </div>`,
})
export class SpaChannelIndicatorComponent {
  @Input() channel?: SpaAppChannelI;
  @Input() channelType?: SpaAppChannelTypeEnum;
  @Input() txtChange!: string;
  @Output() spaChange: EventEmitter<void> = new EventEmitter<void>();

  constructor(
  ) { }

  onChange() {
    this.spaChange.emit();
  }
}
