diff --git a/src/components/FileMessage/ImageMessage.tsx b/src/components/FileMessage/ImageMessage.tsx index e40e1607..f2e75026 100644 --- a/src/components/FileMessage/ImageMessage.tsx +++ b/src/components/FileMessage/ImageMessage.tsx @@ -1,7 +1,7 @@ import { FC, useEffect, useState } from "react"; import { LineWobble, Ping } from "@uiball/loaders"; -import { getDefaultSize, isMobile } from "@/utils"; +import { cn, getDefaultSize, isMobile } from "@/utils"; import ExpiredMessage from "./ExpiredMessage"; type Props = { @@ -19,13 +19,13 @@ const ImageMessage: FC = ({ thumbnail, download, content, - properties + properties, }) => { const url = thumbnail || content; const [status, setStatus] = useState<"loading" | "error" | "loaded">("loading"); const { width = 0, height = 0 } = getDefaultSize(properties, { min: 200, - max: isMobile() ? 300 : 480 + max: isMobile() ? 300 : 480, }); useEffect(() => { const img = new Image(); @@ -38,12 +38,13 @@ const ImageMessage: FC = ({ img.src = url; }, [url]); if (status == "error") return ; + const noSize = !properties?.width; return (
{uploading && ( @@ -58,11 +59,10 @@ const ImageMessage: FC = ({
) : (