UNPKG

@wix/design-system

Version:

@wix/design-system

14 lines 1.9 kB
import React from 'react'; import { st, classes } from './GooglePreview.st.css.js'; import { DEFAULT_TOOLTIP_PROPS, dataHooks } from './constants'; import Text from '../Text'; import { GooglePreviewWebsiteInfo } from './components/GooglePreviewWebsiteInfo'; const GooglePreview = ({ dataHook, previewUrl, title, description, titleMaxLines = 1, descriptionMaxLines = 2, skin = 'light', siteName, favicon, websiteInfoTooltipContent, websiteInfoTooltipProps, onTitleMouseEnter = () => { }, onTitleMouseLeave = () => { }, onDescriptionMouseEnter = () => { }, onDescriptionMouseLeave = () => { }, onWebsiteInfoClick = () => { }, onTitleClick = () => { }, onDescriptionClick = () => { }, }) => (React.createElement("div", { className: st(classes.root, { transparent: skin === 'transparent', }), "data-hook": dataHook }, React.createElement(GooglePreviewWebsiteInfo, { previewUrl: previewUrl, siteName: siteName, favicon: favicon, onClick: onWebsiteInfoClick, tooltipContent: websiteInfoTooltipContent, tooltipProps: websiteInfoTooltipProps }), React.createElement(Text, { className: classes.googlePreviewTitle, dataHook: dataHooks.GooglePreviewTitle, weight: "thin", size: "tiny", secondary: false, light: false, ellipsis: true, tooltipProps: DEFAULT_TOOLTIP_PROPS, maxLines: titleMaxLines, onMouseEnter: onTitleMouseEnter, onMouseLeave: onTitleMouseLeave, onClick: onTitleClick }, title), React.createElement(Text, { className: classes.googlePreviewDescription, weight: "thin", size: "tiny", light: false, dataHook: dataHooks.GooglePreviewDescription, ellipsis: true, tooltipProps: DEFAULT_TOOLTIP_PROPS, maxLines: descriptionMaxLines, onMouseEnter: onDescriptionMouseEnter, onMouseLeave: onDescriptionMouseLeave, onClick: onDescriptionClick }, description))); GooglePreview.displayName = 'GooglePreview'; export default GooglePreview; //# sourceMappingURL=GooglePreview.js.map