diff --git a/gui/src/components/commons/FileInput.tsx b/gui/src/components/commons/FileInput.tsx index bb4cc8205..f2a341754 100644 --- a/gui/src/components/commons/FileInput.tsx +++ b/gui/src/components/commons/FileInput.tsx @@ -12,6 +12,8 @@ import { FileIcon } from './icon/FileIcon'; import { UploadFileIcon } from './icon/UploadFileIcon'; import { Typography } from './Typography'; import { CloseIcon } from './icon/CloseIcon'; +import { FolderIcon } from './icon/FolderIcon'; +import { UploadFolderIcon } from './icon/UploadFolderIcon'; interface InputProps { variant?: 'primary' | 'secondary'; @@ -22,9 +24,11 @@ interface InputProps { export const FileInputContentBlank = ({ isDragging, label, + directory = false, }: { isDragging: boolean; label: string; + directory?: boolean; }) => { return (
- + {directory ? ( + + ) : ( + + )}
any; + directory?: boolean; }) => { return (
- + {directory ? : } {importedFileName}
diff --git a/gui/src/components/commons/TauriFileInput.tsx b/gui/src/components/commons/TauriFileInput.tsx index 97dd0d943..b858b85c3 100644 --- a/gui/src/components/commons/TauriFileInput.tsx +++ b/gui/src/components/commons/TauriFileInput.tsx @@ -24,10 +24,11 @@ export function InnerTauriFileInput({
onChange(await open({ directory }))}> {value !== null ? FileInputContentFile({ + directory, importedFileName: value, onClearPicker: () => onChange(null), }) - : FileInputContentBlank({ isDragging: false, label })} + : FileInputContentBlank({ isDragging: false, label, directory })}
); } diff --git a/gui/src/components/commons/icon/FolderIcon.tsx b/gui/src/components/commons/icon/FolderIcon.tsx new file mode 100644 index 000000000..14b8a659c --- /dev/null +++ b/gui/src/components/commons/icon/FolderIcon.tsx @@ -0,0 +1,12 @@ +export function FolderIcon({ width = 24 }: { width?: number }) { + return ( + + + + ); +} diff --git a/gui/src/components/commons/icon/UploadFolderIcon.tsx b/gui/src/components/commons/icon/UploadFolderIcon.tsx new file mode 100644 index 000000000..98d2bb82a --- /dev/null +++ b/gui/src/components/commons/icon/UploadFolderIcon.tsx @@ -0,0 +1,25 @@ +import classNames from 'classnames'; + +export function UploadFolderIcon({ + width = 24, + isDragging = false, +}: { + width?: number; + isDragging?: boolean; +}) { + return ( + + + + ); +}