feat: add all default components for RTE
This commit is contained in:
committed by
Christel Westerberg
parent
7804f574d6
commit
4006312cfc
@@ -1,11 +1,17 @@
|
||||
import NextImage, { type ImageProps } from "next/image"
|
||||
"use client"
|
||||
|
||||
import NextImage, { type ImageProps, type ImageLoaderProps } 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}
|
||||
src={`${props.src}?`}
|
||||
loader={imageLoader}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user