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

@Component({
  selector: 'spa-welcome',
  template: `<div class="flex flex-col gap-3">
    <spn-button [spfFullWidth]="true" *ngFor="let channel of channels" (click)="onSelectChannel(channel)">
      {{ channel.brand }}
    </spn-button>
  </div>`,
})
export class SpaWelcomeComponent {
  @Input() public channels?: SpaAppChannelI[] = [];
  @Output() public spaSelected: EventEmitter<SpaAppChannelI> = new EventEmitter<SpaAppChannelI>();

  constructor(
  ) { }

  onSelectChannel(channel: SpaAppChannelI) {
    this.spaSelected.emit(channel);
  }
}
