From 264292673468df3713dbb0330a3b2190fb60de17 Mon Sep 17 00:00:00 2001
From: "Thomas F. K. Jorna" <hello@tefkah.com>
Date: Sat, 9 Oct 2021 19:24:35 +0200
Subject: fix: correct image export

---
 components/Sidebar/OrgImage.tsx | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

(limited to 'components/Sidebar/OrgImage.tsx')

diff --git a/components/Sidebar/OrgImage.tsx b/components/Sidebar/OrgImage.tsx
index e8773e2..d602f0c 100644
--- a/components/Sidebar/OrgImage.tsx
+++ b/components/Sidebar/OrgImage.tsx
@@ -12,8 +12,6 @@ export const OrgImage = (props: OrgImageProps) => {
   const { src, file } = props
 
   const [image, setImage] = useState<any>(null)
-  const dir = path.dirname(file)
-  const fullPath = encodeURIComponent(encodeURIComponent(path.join(dir, src)))
 
   /* )
 *   .then((res) => res.blob())
@@ -24,5 +22,12 @@ export const OrgImage = (props: OrgImageProps) => {
 *   })
 }, [fullPath]) */
 
-  return <Image src={`http://localhost:35901/img/${fullPath}`} alt="" width={100} height={100} />
+  const dir = path.dirname(src)
+  const fullPath = encodeURIComponent(encodeURIComponent(path.join(dir, src)))
+
+  const dumbLoader = ({ src, width, quality }: { [key: string]: string | number }) => {
+    return `http://localhost:35901/img/${src}`
+  }
+
+  return <Image unoptimized loader={dumbLoader} src={fullPath} alt="" width={100} height={100} />
 }
-- 
cgit v1.2.3

