diff --git a/web/bun.lockb b/web/bun.lockb index 120c913d..d5338f3e 100755 Binary files a/web/bun.lockb and b/web/bun.lockb differ diff --git a/web/components/ImageFallback.tsx b/web/components/ImageFallback.tsx index f31e65f4..9e449b9e 100644 --- a/web/components/ImageFallback.tsx +++ b/web/components/ImageFallback.tsx @@ -1,29 +1,23 @@ "use client"; - -import { useEffect, useState } from "react"; - type Props = { url?: string; fallback: React.ReactElement; width: string; height: string; - alt: string; }; // https://medium.com/@abhishekmicosoft/handling-img-fallback-307653b2f30 -export function ImageFallback({ width, height, url, fallback, alt }: Props) { - const [ok, setOK] = useState(true); - useEffect(() => { - url; - setOK(true); - }, [url]); +export function ImageFallback({ width, height, url }: Props) { const URL = url?.startsWith("/") ? `${process.env.NEXT_PUBLIC_API_ENDPOINT}${url}` : url; - return ok ? ( - { - console.log("failed to fetch image data of:", URL); - setOK(false); - }} - alt={alt} - /> - ) : ( - <>{fallback} + > + + ); } diff --git a/web/components/human/WithFallback.tsx b/web/components/human/WithFallback.tsx index 2e2f92a9..f9d3981e 100644 --- a/web/components/human/WithFallback.tsx +++ b/web/components/human/WithFallback.tsx @@ -18,7 +18,6 @@ export function AvatarWithFallback({ width, height, url }: Props) { sx={{ width: `${width}`, height: `${height}`, objectFit: "cover" }} /> } - alt="" /> ); } diff --git a/web/public/avatar.svg b/web/public/avatar.svg new file mode 100755 index 00000000..ac3aa6fe --- /dev/null +++ b/web/public/avatar.svg @@ -0,0 +1,6 @@ + +