| 12 | type MaybePromise<T> = T | Promise<T>; |
| 13 | |
| 14 | export interface ConfirmModalProps { |
| 15 | title: string; |
| 16 | children: ReactNode; |
| 17 | onConfirm?: () => MaybePromise<void>; |
| 18 | onCancel?: () => MaybePromise<void>; |
| 19 | closeOnConfirm?: boolean; |
| 20 | closeOnCancel?: boolean; |
| 21 | cancelProps?: ButtonProps & ComponentPropsWithoutRef<"button">; |
| 22 | confirmProps?: ButtonProps & ComponentPropsWithoutRef<"button">; |
| 23 | groupProps?: GroupProps; |
| 24 | |
| 25 | labels?: { |
| 26 | confirm?: stringOrTranslation; |
| 27 | cancel?: stringOrTranslation; |
| 28 | }; |
| 29 | } |
| 30 | |
| 31 | export const ConfirmModal = createModal<Omit<ConfirmModalProps, "title">>(({ actions, innerProps }) => { |
| 32 | const [loading, setLoading] = useState(false); |
nothing calls this directly
no outgoing calls
no test coverage detected