import { Component, Input, OnInit } from '@angular/core';
import { emptyCourseThemeDataFactory } from 'src/app/empty-objects/empty-course-theme-data';
import { CourseThemeData } from 'src/app/structures/course-theme-data';

import * as Globals from '../../../globals';

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

  @Input() themeData: CourseThemeData = emptyCourseThemeDataFactory();

  editThemeLink = Globals.pages.editTheme.path;

  constructor() { }

  ngOnInit(): void {
  }

  getPrettyState(state: string): string {
    var index = Globals.themeStates.findIndex(val => { return val.localeCompare(state) == 0; })
    if(index != -1) {
      return Globals.themeStatesPretty[index];
    }
    return "";
  }

}
