From eeb3bcec19b15e6b7d30f983c8f613dedb1a9b32 Mon Sep 17 00:00:00 2001
From: eug-vs <eugene@eug-vs.xyz>
Date: Sat, 22 Oct 2022 20:06:01 +0300
Subject: refactor: separate Nginx adapter

---
 src/Image.tsx | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

(limited to 'src/Image.tsx')

diff --git a/src/Image.tsx b/src/Image.tsx
index 770c383..37e55ba 100644
--- a/src/Image.tsx
+++ b/src/Image.tsx
@@ -1,13 +1,12 @@
 import ImageBase from 'next/future/image';
 import { FC } from 'react';
+import benzinConfig from './benzinConfig';
 
 type Props = Record<'src' | 'alt', string>;
 
-const IMAGE_CDN = 'http://localhost:8000';
-
 const localizeSrc = (src: string) => {
-  if (process.env.NODE_ENV === 'production' || src.startsWith('http')) return src;
-  return IMAGE_CDN + src;
+  if (src.startsWith('http')) return src;
+  return benzinConfig.CDN + src;
 }
 
 const Image: FC<Props> = ({ src, ...props }) => {
-- 
cgit v1.2.3

