From 830d5a6ca8d980ab763ba605654a65692d0c56a9 Mon Sep 17 00:00:00 2001 From: igorrCarvalho Date: Thu, 30 May 2024 15:11:28 -0300 Subject: [PATCH] Feat: add diferent loading for file and image --- .../chatView/fileComponent/index.tsx | 10 ++-- .../chatView/filePreviewChat/index.tsx | 52 +++++++++++++------ 2 files changed, 40 insertions(+), 22 deletions(-) diff --git a/src/frontend/src/modals/IOModal/components/chatView/fileComponent/index.tsx b/src/frontend/src/modals/IOModal/components/chatView/fileComponent/index.tsx index 62b4a8071..2489824f8 100644 --- a/src/frontend/src/modals/IOModal/components/chatView/fileComponent/index.tsx +++ b/src/frontend/src/modals/IOModal/components/chatView/fileComponent/index.tsx @@ -27,14 +27,14 @@ export default function FileCard({ if (imgTypes.has(fileType)) { return (
generated image {isHovered && (
@@ -59,7 +59,7 @@ export default function FileCard({ {" "} {imgTypes.has(fileType) ? ( diff --git a/src/frontend/src/modals/IOModal/components/chatView/filePreviewChat/index.tsx b/src/frontend/src/modals/IOModal/components/chatView/filePreviewChat/index.tsx index 704efae0f..504d3fe24 100644 --- a/src/frontend/src/modals/IOModal/components/chatView/filePreviewChat/index.tsx +++ b/src/frontend/src/modals/IOModal/components/chatView/filePreviewChat/index.tsx @@ -3,6 +3,8 @@ import IconComponent, { ForwardedIconComponent, } from "../../../../../components/genericIconComponent"; import formatFileName from "./utils/format-file-name"; +import { loadingFileComponent } from "./components/loadingFileComponent/loadingFileComponent"; +import { Skeleton } from "../../../../../components/ui/skeleton"; export default function FilePreview({ error, @@ -22,24 +24,40 @@ export default function FilePreview({ return (
{loading ? ( -
-
+ ) : ( +
- - - -
+
+ +
+ + +
+
+
+ ) ) : error ? (
Error...
) : (