image optimizations

This commit is contained in:
2025-06-12 22:27:20 +02:00
parent 997b2a7828
commit 33948c2dae
6 changed files with 101 additions and 34 deletions

View File

@@ -1,14 +1,8 @@
'use client'
import { CDN_URL } from '@/shared/constants'
import Image from 'next/image'
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} />
export function OptimizedImage(props: ComponentPropsWithoutRef<typeof Image>) {
return <Image {...props} />
}