@sberdevices/plasma-temple
Version:
SberDevices CanvasApp Templates.
39 lines • 2.06 kB
JavaScript
import React from 'react';
import styled from 'styled-components';
import { Body1, Caption, Card, CardBody, CardContent, Footnote1, Price } from '@sberdevices/plasma-ui';
import { IconChevronRight } from '@sberdevices/plasma-icons';
import { secondary } from '@sberdevices/plasma-tokens';
import { detectDevice } from '@sberdevices/plasma-ui/utils';
var StyledCard = /*#__PURE__*/styled(Card).withConfig({
componentId: "plasma-temple__sc-c48g37-0"
})(["margin-bottom:1rem;"]);
var StyledCardContent = /*#__PURE__*/styled(CardContent).withConfig({
componentId: "plasma-temple__sc-c48g37-1"
})(["align-items:center;justify-content:space-between;flex-direction:row;"]);
var StyledCaption = /*#__PURE__*/styled(Caption).withConfig({
componentId: "plasma-temple__sc-c48g37-2"
})(["color:", ";"], secondary);
var mapDeviceToContent = {
sberBox: Body1,
sberPortal: Footnote1,
mobile: Footnote1
};
var Content = mapDeviceToContent[/*#__PURE__*/detectDevice()];
var StyledContentContainer = /*#__PURE__*/styled.div.withConfig({
componentId: "plasma-temple__sc-c48g37-3"
})(["margin-right:auto;"]);
export var ConfirmOrderCard = function ConfirmOrderCard(_ref) {
var title = _ref.title,
content = _ref.content,
caption = _ref.caption,
_ref$price = _ref.price,
price = _ref$price === void 0 ? 0 : _ref$price,
onClick = _ref.onClick;
return /*#__PURE__*/React.createElement(StyledCard, {
onClick: onClick,
outlined: true,
tabIndex: 0,
"data-cy": "confirm-order-card"
}, /*#__PURE__*/React.createElement(CardBody, null, /*#__PURE__*/React.createElement(StyledCardContent, null, /*#__PURE__*/React.createElement(StyledContentContainer, null, /*#__PURE__*/React.createElement(StyledCaption, null, title), /*#__PURE__*/React.createElement(Content, null, content), caption && /*#__PURE__*/React.createElement(StyledCaption, null, caption)), price > 0 && /*#__PURE__*/React.createElement(Price, null, price), /*#__PURE__*/React.createElement(IconChevronRight, null))));
};
//# sourceMappingURL=ConfirmOrderCard.js.map