UI: add placeholder to fileInput
This commit is contained in:
@@ -16,6 +16,7 @@ interface FileInputProps {
|
|||||||
label?: string;
|
label?: string;
|
||||||
error?: string;
|
error?: string;
|
||||||
helperText?: string;
|
helperText?: string;
|
||||||
|
placeholder?: JSX.Element;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,6 +31,7 @@ export function FileInput(props: FileInputProps) {
|
|||||||
"value",
|
"value",
|
||||||
"label",
|
"label",
|
||||||
"error",
|
"error",
|
||||||
|
"placeholder",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Create file list
|
// Create file list
|
||||||
@@ -68,7 +70,11 @@ export function FileInput(props: FileInputProps) {
|
|||||||
>
|
>
|
||||||
<Show
|
<Show
|
||||||
when={getFiles().length}
|
when={getFiles().length}
|
||||||
fallback={<>Click to select file{props.multiple && "s"}</>}
|
fallback={
|
||||||
|
props.placeholder || (
|
||||||
|
<>Click to select file{props.multiple && "s"}</>
|
||||||
|
)
|
||||||
|
}
|
||||||
>
|
>
|
||||||
Selected file{props.multiple && "s"}:{" "}
|
Selected file{props.multiple && "s"}:{" "}
|
||||||
{getFiles()
|
{getFiles()
|
||||||
|
|||||||
Reference in New Issue
Block a user