import { Component, Input, Type } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { IonButton, IonButtons, IonContent, IonHeader, IonIcon, IonTitle, IonToolbar } from '@ionic/angular/standalone';

@Component({
  selector: 'app-image-popup',
  templateUrl: './image-popup.component.html',
  styleUrls: ['./image-popup.component.scss'],
  standalone: true,
  imports: [
    IonContent, IonHeader, IonButton, IonButtons, IonToolbar, IonTitle, IonIcon
  ]
})
export class ImagePopupComponent {
  @Input() imageUrl: string = '';  // 图片URL
  @Input() description: string = '';  // 图片描述
  @Input() component: Type<any> | null = null;  // 动态加载的组件

  constructor(private modalController: ModalController) {}

  close() {
    this.modalController.dismiss();
  }
}
