Files
web/components/Image/index.tsx
Michael Zetterberg 14e93eba7c chore: lint fix
2024-04-23 14:43:17 +02:00

15 lines
405 B
TypeScript

"use client"
import NextImage from "next/image"
import type { ImageLoaderProps, ImageProps } from "next/image"
function imageLoader({ quality, src, width }: ImageLoaderProps) {
return `${src}?w=${width}${quality ? "&q=" + quality : ""}`
}
// Next/Image adds & instead of ? before the params
export default function Image(props: ImageProps) {
return <NextImage {...props} loader={imageLoader} />
}