mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-26 11:21:16 +01:00
Custom content-type for multipart items
This commit is contained in:
@@ -12,6 +12,7 @@ export interface PromptProps {
|
||||
name: InputProps['name'];
|
||||
defaultValue: InputProps['defaultValue'];
|
||||
placeholder: InputProps['placeholder'];
|
||||
require?: InputProps['require'];
|
||||
confirmLabel?: string;
|
||||
}
|
||||
|
||||
@@ -22,6 +23,7 @@ export function Prompt({
|
||||
defaultValue,
|
||||
placeholder,
|
||||
onResult,
|
||||
require = true,
|
||||
confirmLabel = 'Save',
|
||||
}: PromptProps) {
|
||||
const [value, setValue] = useState<string>(defaultValue ?? '');
|
||||
@@ -41,7 +43,7 @@ export function Prompt({
|
||||
>
|
||||
<Input
|
||||
hideLabel
|
||||
require
|
||||
require={require}
|
||||
autoSelect
|
||||
placeholder={placeholder}
|
||||
label={label}
|
||||
|
||||
@@ -14,6 +14,7 @@ export function usePrompt() {
|
||||
defaultValue,
|
||||
placeholder,
|
||||
confirmLabel,
|
||||
require,
|
||||
}: Pick<DialogProps, 'title' | 'description'> &
|
||||
Omit<PromptProps, 'onResult' | 'onHide'> & { id: string }) =>
|
||||
new Promise((onResult: PromptProps['onResult']) => {
|
||||
@@ -24,7 +25,16 @@ export function usePrompt() {
|
||||
hideX: true,
|
||||
size: 'sm',
|
||||
render: ({ hide }) =>
|
||||
Prompt({ onHide: hide, onResult, name, label, defaultValue, placeholder, confirmLabel }),
|
||||
Prompt({
|
||||
onHide: hide,
|
||||
onResult,
|
||||
name,
|
||||
label,
|
||||
defaultValue,
|
||||
placeholder,
|
||||
confirmLabel,
|
||||
require,
|
||||
}),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user