diff --git a/src/components/Img.tsx b/src/components/Img.tsx index 84e0606..e60a372 100644 --- a/src/components/Img.tsx +++ b/src/components/Img.tsx @@ -3,38 +3,29 @@ import Image, { ImageProps } from "next/image"; interface Props { className?: string; - image?: UploadImageFragment; + image?: UploadImageFragment | string; quality?: ImageQuality; alt?: ImageProps["alt"]; layout?: ImageProps["layout"]; objectFit?: ImageProps["objectFit"]; priority?: ImageProps["priority"]; - rawImg?: boolean; } export default function Img(props: Props): JSX.Element { - if (props.image?.width && props.image?.height) { + if (typeof props.image === "string") { + return ( + {props.alt + ); + } else if (props.image?.width && props.image.height) { const imgSize = getImgSizesByQuality( props.image.width, props.image.height, props.quality ?? ImageQuality.Small ); - - if (props.rawImg) { - return ( - // eslint-disable-next-line @next/next/no-img-element - {props.alt - ); - } return (