mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-17 23:13:51 +01:00
Cookie Support (#19)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { dialog } from '@tauri-apps/api';
|
||||
import type { DialogProps } from '../components/core/Dialog';
|
||||
import { useDialog } from '../components/DialogContext';
|
||||
import type { PromptProps } from './Prompt';
|
||||
@@ -13,8 +12,8 @@ export function usePrompt() {
|
||||
label,
|
||||
defaultValue,
|
||||
placeholder,
|
||||
}: Pick<DialogProps, 'title' | 'description'> &
|
||||
Pick<PromptProps, 'name' | 'label' | 'defaultValue' | 'placeholder'>) =>
|
||||
confirmLabel,
|
||||
}: Pick<DialogProps, 'title' | 'description'> & Omit<PromptProps, 'onResult' | 'onHide'>) =>
|
||||
new Promise((onResult: PromptProps['onResult']) => {
|
||||
dialog.show({
|
||||
title,
|
||||
@@ -22,7 +21,7 @@ export function usePrompt() {
|
||||
hideX: true,
|
||||
size: 'sm',
|
||||
render: ({ hide }) =>
|
||||
Prompt({ onHide: hide, onResult, name, label, defaultValue, placeholder }),
|
||||
Prompt({ onHide: hide, onResult, name, label, defaultValue, placeholder, confirmLabel }),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user