UNPKG

@shopgate/engage

Version:
40 lines (39 loc) 1.17 kB
import * as React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { Grid } from '@shopgate/engage/components'; import { detailsLine, detailsIcon, detailsIconLinked, details } from "./Store.style"; /** * Renders a single store headline. * @param {Object} props The component props. * @param {React.ReactElement} props.icon The icon component. * @param {boolean} props.linked Whether the details should be linked. * @param {React.ReactNode} props.children The component children. * @returns {JSX.Element} */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export function StoreDetailsLine({ icon: Icon, children, linked }) { return /*#__PURE__*/_jsxs(Grid, { className: detailsLine, children: [/*#__PURE__*/_jsx(Grid.Item, { shrink: 0, className: classNames(detailsIcon, { [detailsIconLinked]: linked }), children: /*#__PURE__*/_jsx(Icon, { "aria-hidden": true }) }), /*#__PURE__*/_jsx(Grid.Item, { grow: 1, className: details, children: children })] }); } StoreDetailsLine.defaultProps = { linked: false };