import { Component, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonContent, IonHeader, IonTitle,IonCardSubtitle, IonToolbar, IonCard, IonCardHeader, IonCardTitle, IonCardContent, IonButton } from '@ionic/angular/standalone';
import { Router } from '@angular/router';

@Component({
  selector: 'app-card1',
  templateUrl: './card1.page.html',
  styleUrls: ['./card1.page.scss'],
  standalone: true,
  imports: [IonContent, IonHeader, IonTitle, IonToolbar,IonCardSubtitle, IonCard, IonCardHeader, IonCardTitle, IonCardContent, IonButton, CommonModule, FormsModule]
})
export class Card1Page implements OnInit {
  cards: { id: number; title: string; editor: string; detail: string }[] = [
    { id: 1, title: 'Card 1 Title', editor: 'Editor 1', detail: 'Detail for Card 1' },
    { id: 2, title: 'Card 1 Title 2', editor: 'Editor 2', detail: 'Detail for Card 1.2' },
    { id: 3, title: 'Card 1 Title 3', editor: 'Editor 3', detail: 'Detail for Card 1.3' },
  ]; // 示例卡片数据

  constructor(private router: Router) {}

  ngOnInit() {}

  viewItemDetails(card: { id: number }) {
    this.router.navigate(['/card-detail'], { queryParams: { id: card.id } }); // 跳转到详细内容页并带上参数
  }
}
