import { ModalController } from '@ionic/angular/standalone';
import { AgentUserInputComponent } from 'src/agent/agent-user-input/agent-user-input.component';

  // 数据搜集
  //@description
  //https://ionicframework.com/docs/api/modal#controller-modals
  export async function getUserInput(modalCtrl:ModalController,options:{filedsArray:any}){
    const modal = await modalCtrl.create({
      component: AgentUserInputComponent,
      componentProps:{filedsArray:options.filedsArray}
    });
    modal.present();

    const { data, role } = await modal.onWillDismiss();

    if (role === 'confirm') {
      return data;
    }
  }