isomtrik-quickchat
Version:
isomtrik-quickchat is a lightweight, real-time chat component built with Stencil JS. It is designed to be seamlessly integrated into web applications, offering customizable and responsive chat functionalities. The module supports both CommonJS and ES modu
37 lines (35 loc) • 750 B
JavaScript
import { html } from 'lit';
import { styleMap } from 'lit/directives/style-map.js';
import './Image.css';
export const Image = ({
src,
alt = '',
width = 'auto',
height = 'auto',
borderRadius = '0px',
border = 'none',
borderColor = 'transparent',
borderStyle = 'solid',
objectFit,
placeholderImage,
}) => {
return html`
<img
src=${src}
alt=${alt}
@error=${(e) => {
if (placeholderImage) {
e.target.src = placeholderImage;
}
}}
style=${styleMap({
width,
height,
borderRadius,
border: `${borderStyle} ${border} ${borderColor}`,
objectFit,
})}
class="storybook-image"
/>
`;
};