wix-style-react
Version:
wix-style-react
19 lines • 1.08 kB
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import { st, classes } from './Illustration.st.css';
import { dataHooks } from '../../constants';
import { useBaseModalLayoutContext } from '../../BaseModalLayoutContext';
export const Illustration = ({ dataHook, className, children } = {}) => {
const { illustrationClassName, illustration = children } = useBaseModalLayoutContext();
return ((illustration && (React.createElement("div", { "data-hook": dataHook, className: st(classes.root, illustrationClassName, className) }, typeof illustration === 'string' ? (React.createElement("img", { className: classes.image, src: illustration, "data-hook": dataHooks.illustrationSrc })) : (illustration)))) ||
null);
};
Illustration.propTypes = {
/** additional css classes */
className: PropTypes.string,
/** data hook for testing */
dataHook: PropTypes.string,
/** The illustration src or the illustration node itself */
illustration: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
};
//# sourceMappingURL=Illustration.js.map