Skip to content

Commit

Permalink
Corrigindo bug filter com loading
Browse files Browse the repository at this point in the history
  • Loading branch information
mundotv789123 committed Nov 26, 2023
1 parent dfbcced commit 455c203
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/FilesBlocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ export default function FilesBlock(props: { files: Array<FileModel> | null, text
if (props.files?.length == 0 ?? false)
props.text = "Essa pasta está vazia!"

console.log(props.fileLoading);
return (
<Panel>
{props.files === null ? <Loading /> : props.text ? <Text>{props.text}</Text> :
props.files.filter(f => !props.search || f.name.toLowerCase().includes(props.search.toLowerCase())).map((file: FileModel, index: number) => {
return <FileBlock file={file} key={index} loading={props.fileLoading == index}/>
props.files.map((file: FileModel, index: number) => {
return <>{(!props.search || file.name.toLowerCase().includes(props.search.toLowerCase())) && <FileBlock file={file} key={index} loading={props.fileLoading == index}/>}</>
})
}
</Panel>
Expand Down

0 comments on commit 455c203

Please sign in to comment.