Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
hervyt committed Oct 21, 2024
1 parent a4c3e29 commit a7e1b11
Show file tree
Hide file tree
Showing 2 changed files with 328 additions and 221 deletions.
6 changes: 3 additions & 3 deletions packages/filigran-ui/src/components/clients/file-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function GenericFileInput(
{texts, allowedTypes, className, handleFileChange, ...props}: FileInputProps,
ref?: any
) {
const [fileSelected, setFileSelected] = useState<File>(null)
const [fileSelected, setFileSelected] = useState<File | null>(null)
const textForComp: InputText = {...defaultTexts, ...texts}
const handleDragOver = (e: React.DragEvent<HTMLDivElement>) => {
e.preventDefault()
Expand All @@ -50,7 +50,7 @@ function GenericFileInput(
}

const fileClicked = (e: React.ChangeEvent<HTMLInputElement>) => {
setFileSelected(e.target.files[0])
setFileSelected(e.target?.files?.[0] ?? null)
handleFileChange(e.target.files)
}

Expand All @@ -68,7 +68,7 @@ function GenericFileInput(
{...props}
/>
<Button onClick={() => ref.current && ref.current.click()}>
{textForComp?.selectFile}
<>{textForComp?.selectFile}</>
</Button>{' '}
{fileSelected?.name ?? textForComp.noFile}
</div>
Expand Down
Loading

0 comments on commit a7e1b11

Please sign in to comment.