mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 08:28:20 +01:00
26 lines
651 B
TypeScript
26 lines
651 B
TypeScript
import {
|
|
confirmModalService,
|
|
confirmModalWithInputService,
|
|
} from "./service.ts";
|
|
import type { ConfirmModalOptions, ConfirmModalResult } from "./types.ts";
|
|
|
|
export function useConfirmModal() {
|
|
const confirm = (
|
|
options: ConfirmModalOptions,
|
|
): Promise<ConfirmModalResult> => {
|
|
return confirmModalService.confirm(options);
|
|
};
|
|
|
|
const confirmWithInput = (
|
|
options: ConfirmModalOptions,
|
|
placeholder?: string,
|
|
): Promise<ConfirmModalResult> => {
|
|
return confirmModalWithInputService.confirm(options, placeholder);
|
|
};
|
|
|
|
return {
|
|
confirm,
|
|
confirmWithInput,
|
|
};
|
|
}
|