import { Component, OnInit } from '@angular/core';

import { InstructorData } from '../../../structures/instructor-data';
import { LoggedUserData } from '../../../structures/logged-user-data';

import { LoginService } from '../../../services/login.service';

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

@Component({
  selector: 'app-edit-my-profile-page',
  templateUrl: './edit-my-profile-page.component.html',
  styleUrls: ['./edit-my-profile-page.component.scss']
})
export class EditMyProfilePageComponent implements OnInit {

  title = Globals.pages.editMyProfile.text;

  myData: InstructorData | null = null;

  constructor(private loginService: LoginService) {
    this.loginService.userData$.subscribe((data: LoggedUserData | null) => {
      if(data != null && data.instructor != null) {
        this.myData = data.instructor;
      } else {
        this.myData = null;
      }    
    })
    this.loginService.actualizeUserData();
  }

  ngOnInit(): void {}

}
