@shopgate/pwa-common
Version:
Common library for the Shopgate Connect PWA.
33 lines (32 loc) • 927 B
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import styles from "./style";
/**
* The Icon component.
* @param {Object} props The component props.
* @param {string} props.content The SVG content of the icon
* @param {string} [props.className] Additional CSS styles for this component
* @param {string} [props.viewBox] The viewBox attribute passed to the SVG
* @param {number} [props.size=24] The icon size
* @returns {JSX.Element}
*/
import { jsx as _jsx } from "react/jsx-runtime";
const Icon = props => /*#__PURE__*/_jsx("svg", {
className: `${styles} ${props.className} common__icon`,
viewBox: props.viewBox,
xmlns: "http://www.w3.org/2000/svg",
dangerouslySetInnerHTML: {
__html: props.content
},
style: {
fontSize: props.size,
fill: props.color
}
});
Icon.defaultProps = {
className: '',
color: null,
viewBox: '0 0 24 24',
size: 'inherit'
};
export default Icon;