import { Component,CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/angular/standalone';
import { ExploreContainerComponent } from '../explore-container/explore-container.component';
import { IonButton, IonCard, IonCardContent, IonCardHeader, IonCardTitle, IonItem, IonLabel,
   IonList,IonSelect, IonSelectOption } from '@ionic/angular/standalone';
import { CommonModule } from '@angular/common';
import { Router } from '@angular/router';

@Component({
  selector: 'app-tab2',
  templateUrl: 'tab2.page.html',
  styleUrls: ['tab2.page.scss'],
  standalone: true,
  imports: [IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent,
    IonCard,IonCardHeader,IonCardTitle,IonCardContent,
    IonItem,IonLabel,
    IonSelect,IonSelectOption,
    IonButton,IonList,
    CommonModule
  ],
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class Tab2Page {

  constructor(
    private router:Router,
    ) {

  }
  //selectedIssue:string='';
  matchedCounselor: { name: string; specialty: string } | null = null;

  questions = [
    {
      title: '如何应对焦虑？',
      advice: '尝试深呼吸和正念冥想，保持规律的作息。',
      expanded: false,
    },
    {
      title: '如何提高自信心？',
      advice: '设定小目标并逐步实现，进行积极自我对话。',
      expanded: false,
    },
    {
      title: '如何改善人际关系？',
      advice: '多与他人沟通，倾听对方的感受。',
      expanded: false,
    },
  ];

  matchCounselor() {
    // 这里可以根据selectedIssue进行匹配逻辑
    //if (this.selectedIssue === 'anxiety') {
      //this.matchedCounselor = { name: '张医生', specialty: '焦虑' };
    //} else if (this.selectedIssue === 'depression') {
      //this.matchedCounselor = { name: '李医生', specialty: '抑郁' };
    //} else if (this.selectedIssue === 'relationship') {
      //this.matchedCounselor = { name: '王医生', specialty: '人际关系' };
    //} else {
      //this.matchedCounselor = null;
    //}
  }
  goChat(){
      this.router.navigateByUrl("/chat/session/role/2DXJkRsjXK")
  }
}