import { Component } from '@angular/core';
import { NavController } from '@ionic/angular';

import {
  IonHeader,
  IonToolbar,
  IonTitle,
  IonContent,
  IonButton,
  IonButtons,
  IonIcon,
  IonSearchbar,
  IonCard,
  IonCardHeader,
  IonCardContent,
  IonCardTitle,
  IonList,
  IonItem,
  IonLabel,
  IonGrid,
  IonRow,
  IonCol,
  IonThumbnail,
  IonAvatar,
  IonMenuButton,
  IonCardSubtitle,
  IonTabs,
  IonTabBar,
  IonTabButton,
  IonSegment,
  IonSegmentButton,
} from '@ionic/angular/standalone';
import { ExploreContainerComponent } from '../explore-container/explore-container.component';
import { EdittagComponent } from '../edittag/edittag.component';
import { WeatherComponent } from '../weather/weather.component'; // 路径根据实际情况调整

import { CommonModule } from '@angular/common';
import { addIcons } from 'ionicons';
import {
  people,
  compass,
  helpCircle, // 注意：`help-circle` 在 TypeScript 中是 `helpCircle`
  calendar,
  chatbubbles,
} from 'ionicons/icons';
import { Router } from '@angular/router';

import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';

@Component({
  selector: 'app-tab1',
  templateUrl: 'tab1.page.html',
  styleUrls: ['tab1.page.scss'],
  standalone: true,
  imports: [
    IonSegmentButton,
    IonSegment,
    IonTabButton,
    IonTabBar,
    IonHeader,
    IonToolbar,
    IonTitle,
    IonContent,
    ExploreContainerComponent,
    IonButton,
    IonButtons,
    IonIcon,
    IonSearchbar,
    IonCard,
    IonCardHeader,
    IonCardContent,
    IonCardTitle,
    IonList,
    IonItem,
    IonLabel,
    IonGrid,
    IonRow,
    IonCol,
    IonThumbnail,
    IonAvatar,
    IonMenuButton,
    IonCardSubtitle,
    IonTabs,
    EdittagComponent,
    CommonModule,
    WeatherComponent,
  ],
})
export class Tab1Page {
  constructor(private router: Router) {
    addIcons({
      people: people,
      compass: compass,
      'help-circle': helpCircle, // 使用破折号命名
      calendar: calendar,
      chatbubbles: chatbubbles,
    });
  }
  goToPage1() {
    this.router.navigate(['/tabs/recommend']);
  }
  articles = [
    { title: '探索南昌的历史', summary: '南昌的历史悠久，让我们一起探索...' },
    { title: '最佳旅游季节', summary: '了解在什么时间去南昌旅游最合适...' },
    { title: '当地美食推荐', summary: '南昌的特色美食，不容错过的美味...' },
  ];
  images = [
    {
      src: 'C:/Users/布丁撞奶茶/Desktop/工作室作业/代码/s202226701012/workspace/travel-app/src/app/img/tengwangge.png',
      alt: 'Image 1',
    },
    // { src: 'path/to/image2.jpg', alt: 'Image 2' },
    // { src: 'path/to/image3.jpg', alt: 'Image 3' },
    // 添加更多图片路径和替代文本
  ];
  goViewplacePage() {
    this.router.navigate(['/tabs/viewplace']);
  }
}
