-
-
-
- {name}
+
+
+
+ {error ? "File not Found" : name}
- {_size}
+ {error ? "File expired or deleted" : _size}
{error ? (
diff --git a/src/components/FileMessage/OtherFileMessage.tsx b/src/components/FileMessage/OtherFileMessage.tsx
index f866953e..6a595b37 100644
--- a/src/components/FileMessage/OtherFileMessage.tsx
+++ b/src/components/FileMessage/OtherFileMessage.tsx
@@ -13,7 +13,7 @@ const ExpireTip = () => {
const { t } = useTranslation("chat");
return (
- {t("file_expired")}
+
);
};
@@ -42,7 +42,7 @@ const OtherFileMessage = ({
handleCancel
}: Props) => {
const [error, setError] = useState(false);
- const icon = getFileIcon(content_type, name, "w-9 shrink-0 h-auto");
+ const icon = getFileIcon(content_type, name, `w-9 shrink-0 h-auto ${error ? "grayscale" : ""}`);
useEffect(() => {
if (content) {
fetch(content)
@@ -62,9 +62,9 @@ const OtherFileMessage = ({
return (
@@ -72,15 +72,17 @@ const OtherFileMessage = ({
- {name}
+ {error ? "File not Found" : name}
{sending ? (
+ ) : error ? (
+ File expired or deleted
) : (
<>
{formatBytes(size)}
diff --git a/src/components/FileMessage/VideoMessage.tsx b/src/components/FileMessage/VideoMessage.tsx
index 6fbad18b..5094ba93 100644
--- a/src/components/FileMessage/VideoMessage.tsx
+++ b/src/components/FileMessage/VideoMessage.tsx
@@ -43,10 +43,8 @@ const VideoMessage = ({ url, name, size, download }: Props) => {
return (
{!error && (
@@ -54,23 +52,23 @@ const VideoMessage = ({ url, name, size, download }: Props) => {
)}
-
-
+
+
- {name}
+ {error ? "File not Found" : name}
- {_size}
+ {error ? "File expired or deleted" : _size}
{error ? (
diff --git a/src/components/VoiceMessage.tsx b/src/components/VoiceMessage.tsx
index e83e6384..5794121f 100644
--- a/src/components/VoiceMessage.tsx
+++ b/src/components/VoiceMessage.tsx
@@ -121,7 +121,7 @@ const VoiceMessage = ({ file_path }: { file_path: string }) => {
)}
-
+
{status == "loading" && Loading voice message...}
{status == "error" && (
Load voice message error