import { Component, OnInit } from '@angular/core';
import {
  IonSearchbar,
  IonToolbar,
  IonTitle,
  IonHeader,
  IonContent,
  IonCard,
  IonCardHeader,
  IonCardTitle,
  IonList,
  IonCardContent,
  IonItem,
  IonLabel,
  IonButton,
  IonIcon,
  IonInput,
  IonCardSubtitle,
} from '@ionic/angular/standalone';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { CommonModule } from '@angular/common';
import { CloudUser } from 'src/lib/ncloud';
@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.scss'],
  standalone: true,
  imports: [
    IonList,
    IonCard,
    IonContent,
    IonHeader,
    IonSearchbar,
    IonToolbar,
    IonTitle,
    IonCard,
    IonCardHeader,
    IonCardTitle,
    IonCardContent,
    IonItem,
    IonLabel,
    IonButton,
    IonIcon,
    IonInput,
    CommonModule,
    IonCardSubtitle,
  ],
})
export class LoginComponent implements OnInit {
  currentUser: CloudUser | undefined;
  constructor() {
    this.currentUser = new CloudUser();
  }
  async login() {
    let user: any = new CloudUser();
    user = await user.login('test', 'test');
    if (user?.id) {
      this.currentUser = user;
    }
  }
  logout() {
    this.currentUser?.logout();
  }
  signup() {}
  editUser() {}
  ngOnInit() {}
}
