add image optimization

This commit is contained in:
2025-04-11 17:34:09 +02:00
parent 2ccc56c1de
commit 7c6c0c155d
3 changed files with 36 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
'use client'
import { CDN_URL } from '@/shared/constants'
import type { ComponentPropsWithoutRef } from 'react'
export function OptimizedImage(props: ComponentPropsWithoutRef<'img'>) {
const isDev = process.env.NODE_ENV === 'development'
if (isDev) {
return <img {...props} />
}
return <img {...props} src={`${CDN_URL}${props.src}`} alt={props.alt} />
}