import { Component, OnInit } from '@angular/core';
import { IonicModule, NavController } from '@ionic/angular';
import { IonContent, IonHeader, IonIcon, ModalController } from '@ionic/angular/standalone';
import { addIcons } from 'ionicons';
import { arrowBackOutline, chevronForwardOutline } from 'ionicons/icons';
import { CloudUser } from 'src/lib/ncloud';
import { openUserEditModal } from 'src/lib/user/modal-user-edit/modal-user-edit.component';
addIcons({ arrowBackOutline, chevronForwardOutline });
@Component({
  selector: 'app-user-info',
  templateUrl: './user-info.component.html',
  styleUrls: ['./user-info.component.scss'],
  standalone: true,
  imports: [IonHeader,IonContent,IonIcon]

})
export class UserInfoComponent implements OnInit {
  currentUser: any;
  constructor(private navCtrl: NavController, private modalCtrl: ModalController) {
    this.currentUser = new CloudUser();
  }
  async ionViewWillEnter() {
    this.currentUser.readCache();
  }
  ngOnInit() { }

  goBack() {
    this.navCtrl.back();
  }

  async edit(option: string) {
    this.currentUser =await openUserEditModal(this.modalCtrl, option);
  }
}
