import React, { FC, HTMLAttributes } from 'react'; export interface ResponsiveImageProps extends HTMLAttributes { /** Un testo alternativo per descrivere l'immagine mostrata */ alt: string; /** L'URI dell'immagine da mostrare */ src: string; /** Il titolo dell'immagine */ title?: string; testId?: string; /** Indica se l'immagine deve essere considerata proporzionata */ proportioned?: boolean; } export const ResponsiveImage: FC = ({ alt, testId, proportioned = false, children, ...attributes }) => { if (children) { if (proportioned) { return (
{alt} {children}
); } else { return (
{alt} {children}
); } } else { return (
{alt}
); } };