import { Component, NgModule, OnInit } from '@angular/core';
import { ModalController, IonModal, IonHeader, IonToolbar, IonTitle, IonContent, IonList, IonItem, IonLabel, IonAvatar, IonButton, IonSegment, IonSegmentButton, IonSegmentContent, IonSegmentView, IonCardContent, IonCardTitle, IonCardHeader, IonCard, IonIcon, IonButtons, IonInput } from '@ionic/angular/standalone';
import { addIcons } from 'ionicons';
import { airplane, bluetooth, call, wifi } from 'ionicons/icons';
import { CommonModule } from '@angular/common';
import { CloudObject, CloudQuery, CloudUser } from 'src/lib/ncloud';
// import { FmMarkdownPreview } from 'fmode-ng';
import { Router } from '@angular/router';
addIcons({ airplane, bluetooth, call, wifi });
@Component({
  selector: 'page-my-health',
  templateUrl: './page-my-health.component.html',
  styleUrls: ['./page-my-health.component.scss'],
  standalone: true,
    imports: [
      IonHeader, IonToolbar, IonTitle, IonContent,
      IonLabel,IonItem,IonList,IonAvatar,CommonModule,IonButton,
      IonSegment, IonSegmentButton,
      IonSegmentContent,IonSegmentView,IonCardContent, IonCardTitle, IonCardHeader,IonCard,
      IonModal,IonIcon, IonButtons,IonInput,
      // FmMarkdownPreview,
    ]
})
export class PageMyHealthComponent  implements OnInit {

avatar : string = "../assets/imgs/avatar.png";
  currentUser : CloudUser | undefined ;
  objectId : string = "";

  constructor(
    private router: Router
  ) {
    
  }
  allMessage : Array<CloudObject> = [];
  async loadData(){
    this.currentUser = new CloudUser();
    this.avatar = this.currentUser.data["avatar"];
    this.objectId = this.currentUser.data['objectId'];
    let query = new CloudQuery('Consultation');
    this.allMessage = await query.find();
    console.log("allMessage",this.allMessage);
  }
   
  ngOnInit() {
    this.loadData();
  }
  back:string = "back"
  backHome(){
    this.router.navigate(['/tabs/tab1']);
  }
  gotouser(){

  }
}
