File size: 502 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import type { ModalProps } from '@adminjs/design-system'

import { SHOW_MODAL, HIDE_MODAL } from '../store/index.js'

export interface ModalData {
  modalProps: ModalProps;
  type?: 'alert' | 'confirm';
  resourceId?: string;
  confirmAction?: () => void;
}

export type ModalFunctions = {
  openModal: (data: ModalData) => void
  closeModal: () => void
}

export type ShowModalResponse = {
  type: typeof SHOW_MODAL
  data: ModalData;
}

export type HideModalResponse = {
  type: typeof HIDE_MODAL;
}