mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-04-17 10:28:46 -04:00
all components should accept additional classnames
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import NextImage from "next/image";
|
||||
import classNames from "classnames";
|
||||
import type { ImageProps as NextImageProps } from "next/image";
|
||||
|
||||
import styles from "./Image.module.css";
|
||||
|
||||
const Image = ({ src, width, height, alt, quality, priority }: NextImageProps) => {
|
||||
const Image = ({ src, width, height, alt, quality, priority, className, ...rest }: NextImageProps) => {
|
||||
return (
|
||||
<div className={styles.wrapper}>
|
||||
<div className={classNames(styles.wrapper, className)}>
|
||||
<NextImage
|
||||
src={(src as string).replace(/^\/public/g, "")}
|
||||
layout="intrinsic"
|
||||
@@ -15,6 +16,7 @@ const Image = ({ src, width, height, alt, quality, priority }: NextImageProps) =
|
||||
quality={quality || 65}
|
||||
loading={priority ? "eager" : "lazy"}
|
||||
priority={!!priority}
|
||||
{...rest}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user