From 27ff3104aabed240470d351bda02095d8169501f Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 12 Apr 2022 16:09:21 +0200
Subject: chore: add a Summary component

---
 src/components/molecules/images/responsive-image.tsx | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

(limited to 'src/components/molecules/images/responsive-image.tsx')

diff --git a/src/components/molecules/images/responsive-image.tsx b/src/components/molecules/images/responsive-image.tsx
index 9f96f18..3d54e95 100644
--- a/src/components/molecules/images/responsive-image.tsx
+++ b/src/components/molecules/images/responsive-image.tsx
@@ -12,6 +12,10 @@ type ResponsiveImageProps = Omit<ImageProps, 'alt' | 'width' | 'height'> & {
    * A figure caption.
    */
   caption?: string;
+  /**
+   * Set additional classnames to the figure wrapper.
+   */
+  className?: string;
   /**
    * The image height.
    */
@@ -34,16 +38,22 @@ type ResponsiveImageProps = Omit<ImageProps, 'alt' | 'width' | 'height'> & {
 const ResponsiveImage: VFC<ResponsiveImageProps> = ({
   alt,
   caption,
+  className = '',
   layout,
   objectFit,
   target,
   ...props
 }) => {
   return (
-    <figure className={styles.wrapper}>
+    <figure className={`${styles.wrapper} ${className}`}>
       {target ? (
         <Link href={target} className={styles.link}>
-          <Image alt={alt} layout={layout || 'intrinsic'} {...props} />
+          <Image
+            alt={alt}
+            layout={layout || 'intrinsic'}
+            objectFit={objectFit || 'contain'}
+            {...props}
+          />
           {caption && (
             <figcaption className={styles.caption}>{caption}</figcaption>
           )}
-- 
cgit v1.2.3

