UNPKG

@shopify/polaris

Version:

Shopify’s product component library

26 lines (23 loc) 751 B
import React$1 from 'react'; import { classNames, variationName } from '../../utilities/css.js'; import { Image as Image$1 } from '../Image/Image.js'; import { Icon as Icon$1 } from '../Icon/Icon.js'; import styles from './Thumbnail.scss.js'; function Thumbnail({ source, alt, size = 'medium' }) { const className = classNames(styles.Thumbnail, size && styles[variationName('size', size)]); const content = typeof source === 'string' ? /*#__PURE__*/React$1.createElement(Image$1, { alt: alt, source: source }) : /*#__PURE__*/React$1.createElement(Icon$1, { accessibilityLabel: alt, source: source }); return /*#__PURE__*/React$1.createElement("span", { className: className }, content); } export { Thumbnail };