Track dialogs

This commit is contained in:
Gregory Schier
2024-01-28 16:33:36 -08:00
parent 15714ae188
commit fb11aff03f
29 changed files with 111 additions and 89 deletions

View File

@@ -6,6 +6,7 @@ import { Prompt } from './Prompt';
export function usePrompt() {
const dialog = useDialog();
return ({
id,
title,
description,
name,
@@ -13,9 +14,11 @@ export function usePrompt() {
defaultValue,
placeholder,
confirmLabel,
}: Pick<DialogProps, 'title' | 'description'> & Omit<PromptProps, 'onResult' | 'onHide'>) =>
}: Pick<DialogProps, 'title' | 'description'> &
Omit<PromptProps, 'onResult' | 'onHide'> & { id: string }) =>
new Promise((onResult: PromptProps['onResult']) => {
dialog.show({
id,
title,
description,
hideX: true,