import {
  Component,
  OnInit,
  ChangeDetectorRef,
  Output,
  EventEmitter
} from '@angular/core';
import { FormGroup, FormBuilder } from '@angular/forms';
import { MatTabChangeEvent } from '@angular/material';

@Component({
  selector: 'ucap-settings-general',
  templateUrl: './general.component.html',
  styleUrls: ['./general.component.scss']
})
export class GeneralComponent implements OnInit {
  loginForm: FormGroup;

  @Output()
  selectTheme = new EventEmitter<string>();

  constructor(
    private formBuilder: FormBuilder,
    private changeDetectorRef: ChangeDetectorRef
  ) {}

  ngOnInit() {}

  onSelectedTabChange(e: MatTabChangeEvent) {
    let theme = 'theme-default';
    switch (e.index) {
      case 0:
        theme = 'theme-default';
        break;
      case 1:
        theme = 'theme-lgRed';
        break;
      default:
        break;
    }

    this.selectTheme.emit(theme);
  }

  onClickLogin() {}
}
