feat: add all default components for RTE

This commit is contained in:
Simon Emanuelsson
2024-02-13 10:44:54 +01:00
committed by Christel Westerberg
parent 7804f574d6
commit 4006312cfc
3 changed files with 159 additions and 13 deletions

View File

@@ -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}
/>
)
}