import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { NavController } from '@ionic/angular';
import { CloudObject } from 'src/lib/ncloud';

@Component({
  selector: 'app-page-selectlist',
  templateUrl: './page-selectlist.page.html',
  styleUrls: ['./page-selectlist.page.scss'],
})
export class PageSelectlistPage {
  searchQuery : string = '';
  searchResults: CloudObject[] = [];
  constructor(private navCtrl: NavController,private router:Router) {
    const navigation = this.router.getCurrentNavigation();
    if (navigation?.extras?.state) {
      this.searchResults = navigation.extras.state['searchResults'];
      console.log('Received search results:', this.searchResults);
    }
   
  }

  goToDetail(recipeId : any) {
    this.navCtrl.navigateForward(`/tabs/tab1/page-selectlist/page-selectlist-detail/${recipeId}`);
    console.log('Navigating to page-collections-detail');
  }

  // goBack() {
  //   this.navCtrl.navigateBack(['/tabs/tab1']);
  // }
}