import {Component, OnInit} from '@angular/core';
import {CVTimeLineItem} from '../../model/educationitem';
import {StateService} from '../../services/state.service';

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

  constructor(private stateService: StateService) {
  }

  ngOnInit() {
  }

  getEducationItems(): CVTimeLineItem[] {
    const temp = [

      new CVTimeLineItem()
        .setLanguage('nl')
        .setEmployer('Universiteit Gent')
        .setTitle('Doctor in de ingenieurswetenschappen: computerwetenschappen')
        .setDescription('Manuscript: "XPath-gebaseerde informatie-extractie" - informatie extraheren uit semi-gestructureerde documenten ' +
          'zoals HTML, gebruik makend van XPath')
        .setFromYear(2010)
        .setToYear(2017)
        .setIconName('assets/images/ugent-icon.png'),
      new CVTimeLineItem()
        .setLanguage('en')
        .setEmployer('Ghent University')
        .setTitle('Doctor of Computer Science Engineering')
        .setDescription('Manuscript: "XPath-based information extraction" - extraction of information from semi-structured documents, such as ' +
          'HTML, using XPath')
        .setFromYear(2010)
        .setToYear(2017)
        .setIconName('assets/images/ugent-icon.png'),

      new CVTimeLineItem()
        .setLanguage('nl')
        .setEmployer('Universiteit Gent')
        .setTitle('Master, computerwetenschappen - software ontwikkeling, cum laude')
        .setFromYear(2003)
        .setToYear(2010)
        .setIconName('assets/images/ugent-icon.png'),
      new CVTimeLineItem()
        .setLanguage('en')
        .setEmployer('Ghent University')
        .setTitle('Master, computer sciences - software engineering, cum laude')
        .setFromYear(2003)
        .setToYear(2010)
        .setIconName('assets/images/ugent-icon.png'),

      new CVTimeLineItem()
        .setLanguage('nl')
        .setEmployer('Leonardo Lyceum/Pestalozzi')
        .setTitle('Latijn + Wetenschappen / Wiskunde')
        .setFromYear(1999)
        .setToYear(2003)
        .setIconName('assets/images/pestalozzi-icon.png'),
      new CVTimeLineItem()
        .setLanguage('en')
        .setEmployer('Leonardo Lyceum/Pestalozzi')
        .setTitle('Latin + Sciences / Math')
        .setFromYear(1999)
        .setToYear(2003)
        .setIconName('assets/images/pestalozzi-icon.png'),

      new CVTimeLineItem()
        .setLanguage('nl')
        .setEmployer('Leonardo Lyceum Esemnegen')
        .setTitle('Latijn')
        .setFromYear(1997)
        .setToYear(1999)
        .setIconName('assets/images/zotvana.jpg'),
      new CVTimeLineItem()
        .setLanguage('en')
        .setEmployer('Leonardo Lyceum Esemnegen')
        .setTitle('Latin')
        .setFromYear(1997)
        .setToYear(1999)
        .setIconName('assets/images/zotvana.jpg'),
    ];
    const res = new Array<CVTimeLineItem>();
    temp.forEach(value => {
      if (value.language === this.stateService.getLanguage()) {
        res.push(value);
      }
    });
    return res;
  }

  getExperienceItems(): CVTimeLineItem[] {
    const temp = [
      new CVTimeLineItem()
        .setLanguage('nl')
        .setEmployer('Universiteit Gent')
        .setDescription('Postdoctoraal onderzoeker')
        .setFromYear(2017)
        .setFromMonth('maart')
        .setIconName('assets/images/ugent-icon.png'),
      new CVTimeLineItem()
        .setLanguage('en')
        .setEmployer('Ghent University')
        .setDescription('Postdoctoral researcher')
        .setFromYear(2017)
        .setFromMonth('mar')
        .setIconName('assets/images/ugent-icon.png'),

      new CVTimeLineItem()
        .setLanguage('nl')
        .setEmployer('Universiteit Gent')
        .setDescription('doctoraatstudent / assistent')
        .setFromYear(2010)
        .setToYear(2017)
        .setIconName('assets/images/ugent-icon.png')
        .setFromMonth('april').setToMonth('maart'),
      new CVTimeLineItem()
        .setLanguage('en')
        .setEmployer('Ghent University')
        .setDescription('PhD student / assistent')
        .setFromYear(2010)
        .setToYear(2017)
        .setIconName('assets/images/ugent-icon.png')
        .setFromMonth('apr').setToMonth('mar'),

      new CVTimeLineItem()
        .setLanguage('nl')
        .setEmployer('Oxynade')
        .setDescription('Software ontwikkelaar')
        .setFromYear(2009)
        .setToYear(2010)
        .setIconName('assets/images/oxynade-icon.png')
        .setFromMonth('november').setToMonth('april'),
      new CVTimeLineItem()
        .setLanguage('en')
        .setEmployer('Oxynade')
        .setDescription('Software developer')
        .setFromYear(2009)
        .setToYear(2010)
        .setIconName('assets/images/oxynade-icon.png')
        .setFromMonth('nov').setToMonth('apr')
    ];

    const res = Array<CVTimeLineItem>();
    temp.forEach(t => {
      if (t.language === this.stateService.getLanguage()) {
        res.push(t);
      }
    });

    return res;
  }

}
