Custom HTTP method names

This commit is contained in:
Gregory Schier
2024-01-17 14:52:19 -08:00
parent 466d412e65
commit 321c3862fe
8 changed files with 128 additions and 77 deletions

View File

@@ -1,3 +1,4 @@
import { dialog } from '@tauri-apps/api';
import type { DialogProps } from '../components/core/Dialog';
import { useDialog } from '../components/DialogContext';
import type { PromptProps } from './Prompt';
@@ -11,20 +12,17 @@ export function usePrompt() {
name,
label,
defaultValue,
}: {
title: DialogProps['title'];
description?: DialogProps['description'];
name: PromptProps['name'];
label: PromptProps['label'];
defaultValue: PromptProps['defaultValue'];
}) =>
placeholder,
}: Pick<DialogProps, 'title' | 'description'> &
Pick<PromptProps, 'name' | 'label' | 'defaultValue' | 'placeholder'>) =>
new Promise((onResult: PromptProps['onResult']) => {
dialog.show({
title,
description,
hideX: true,
size: 'sm',
render: ({ hide }) => Prompt({ onHide: hide, onResult, name, label, defaultValue }),
render: ({ hide }) =>
Prompt({ onHide: hide, onResult, name, label, defaultValue, placeholder }),
});
});
}