import { Component } from '@angular/core';
import { IonHeader, IonToolbar, IonTitle, IonContent, IonCard, IonCardContent, IonCardHeader, IonChip, IonButton, IonButtons, IonList, IonItem, IonIcon } from '@ionic/angular/standalone';

import { ExploreContainerComponent } from '../explore-container/explore-container.component';
import { Router } from '@angular/router';
import { CommonModule } from '@angular/common';

@Component({
  selector: 'app-tab1',
  templateUrl: 'tab1.page.html',
  styleUrls: ['tab1.page.scss'],
  standalone: true,
  imports: [
    CommonModule,
    IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent,
    IonCard,IonCardContent,IonCardHeader,IonChip,
    IonButton,IonButtons,IonList,IonItem,IonIcon
  ],
})
export class Tab1Page {
  currentDate: Date = new Date();
  sleepDuration: string = '7小时30分钟';
  sleepTime: string = '22:30';
  wakeTime: string = '06:00';
  lastDreamDescription: string = '在海边漫步';
  emotion: string = '放松';
  dreamImages: string[] = [
    'assets/images/dream1.jpg',
    'assets/images/dream2.jpg',
    'assets/images/dream3.jpg',
  ];
  improvementSuggestion: string = '保持卧室安静和黑暗';
  sleepTips: string[] = [
    '定时作息，建立良好睡眠习惯',
    '避免晚上使用电子设备',
    '保持卧室温度适宜',
  ];

  constructor(private router: Router) {}

  getSleepQualityStars(): number[] {
    return Array(4).fill(0); // 假设4颗星
  }

  recordDream() {
    // 记录梦境的逻辑
  }

  analyzeDream() {
    // 解梦的逻辑
  }

  viewAllDreams() {
    // 查看所有梦境的逻辑
  }

  openSettings() {
    // 打开设置页面的逻辑
  }

  openProfile() {
    // 打开个人资料页面的逻辑
  }

  navigateTo(page: string) {
    this.router.navigate([page]);
  }
}
