"use client";
import { jsx } from 'react/jsx-runtime';
import { cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
import styles from './image.module.css.js';

const image = cva(styles.image, {
    variants: {
        fit: {
            contain: styles['image-contain'],
            cover: styles['image-cover'],
            fill: styles['image-fill']
        },
        radius: {
            none: styles['image-radius-none'],
            small: styles['image-radius-small'],
            medium: styles['image-radius-medium'],
            full: styles['image-radius-full']
        }
    },
    defaultVariants: {
        fit: 'cover',
        radius: 'none'
    }
});
function Image({ alt = '', className, fit, radius, fallback, onError, width, height, style, loading = 'lazy', decoding = 'async', ...props }) {
    const handleError = (event) => {
        if (fallback) {
            event.currentTarget.src = fallback;
        }
        onError?.(event);
    };
    const imageStyle = {
        width: width,
        height: height,
        ...style
    };
    return (jsx("img", { alt: alt, className: image({ fit, radius, className }), onError: handleError, style: imageStyle, loading: loading, decoding: decoding, ...props, role: 'img', "aria-label": alt }));
}
Image.displayName = 'Image';

export { Image };
//# sourceMappingURL=image.js.map
