From 7c6c0c155d9aeb80fcdcee3e56dfafcd2a37847a Mon Sep 17 00:00:00 2001 From: Andres Date: Fri, 11 Apr 2025 17:34:09 +0200 Subject: [PATCH] add image optimization --- src/app/docs/[[...slug]]/page.tsx | 21 ++++++++++++++++++++- src/components/optimized-image.tsx | 14 ++++++++++++++ src/shared/constants.ts | 2 ++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/components/optimized-image.tsx diff --git a/src/app/docs/[[...slug]]/page.tsx b/src/app/docs/[[...slug]]/page.tsx index 78f6cdf..4e6a60d 100644 --- a/src/app/docs/[[...slug]]/page.tsx +++ b/src/app/docs/[[...slug]]/page.tsx @@ -7,6 +7,7 @@ import { Mult } from '@/app/_components/mult' import { Spectral } from '@/app/_components/spectral' import { Xmult } from '@/app/_components/xmult' import { Button } from '@/components/ui/button' +import { CDN_URL } from '@/shared/constants' import { ImageZoom } from 'fumadocs-ui/components/image-zoom' import defaultMdxComponents from 'fumadocs-ui/mdx' import { @@ -42,7 +43,25 @@ export default async function Page(props: { , + img: (props) => { + const isDev = + process.env.NODE_ENV === 'development' || + process.env.IS_PREVIEW === 'true' + if (isDev) { + return + } + + return ( + + ) + }, Button: (props) =>