@botonic/react
Version:
Build Chatbots using React
25 lines • 943 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import styled from 'styled-components';
import { COLORS, WEBCHAT } from '../constants';
import { staticAsset } from '../util/environment';
import { renderComponent } from '../util/react';
const PicStyled = styled.img `
border-top-left-radius: 8px;
border-top-right-radius: 8px;
width: ${WEBCHAT.DEFAULTS.ELEMENT_WIDTH}px;
height: 140px;
background: ${COLORS.SOLID_WHITE};
object-fit: center/cover;
border-bottom: 1px solid ${COLORS.SEASHELL_WHITE};
`;
export const Pic = (props) => {
props = Object.assign(Object.assign({}, props), { src: staticAsset(props.src) });
const renderBrowser = () => _jsx(PicStyled, { src: props.src });
// @ts-ignore
const renderNode = () => _jsx("pic", { children: props.src });
return renderComponent({ renderBrowser, renderNode });
};
Pic.serialize = (props) => {
return { pic: props.src };
};
//# sourceMappingURL=pic.js.map