import { inject, InjectionKey } from 'vue'
export interface DialogShowOptions {
  title?: string
  text?: string
  actions?: any
  form?: boolean
  schema?: any
  action?: Function
  formData?: any
  onConfirm?: Function
}
export const HonorDialogSymbol: InjectionKey<{
  show: (options: DialogShowOptions) => void
}> = Symbol.for('HonorDialogContext')
export const useHonorDialog = () => {
  const honorDialog = inject(HonorDialogSymbol)
  if (!honorDialog) {
    throw new Error('useHonorDialog must be used inside setup()')
  }
  return {
    show: honorDialog.show,
  }
}
