@chatui/core
Version:
The React library for Chatbot UI
38 lines • 1.43 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import React from 'react';
import clsx from 'clsx';
import { Goods } from '../Goods';
import { Flex, FlexItem } from '../Flex';
import { ImageList } from '../ImageList';
import { Icon } from '../Icon';
export var OrderObject = function OrderObject(props) {
var className = props.className,
title = props.title,
_props$list = props.list,
list = _props$list === void 0 ? [] : _props$list,
_props$count = props.count,
count = _props$count === void 0 ? list.length : _props$count,
onClick = props.onClick;
var firstOrder = list[0];
return /*#__PURE__*/React.createElement("div", {
className: clsx('OrderObject', className),
onClick: onClick
}, title && /*#__PURE__*/React.createElement("div", {
className: "OrderObject-title"
}, title), count > 1 ? /*#__PURE__*/React.createElement(Flex, {
alignItems: "center"
}, /*#__PURE__*/React.createElement(FlexItem, null, /*#__PURE__*/React.createElement(ImageList, {
list: list.slice(0, 3).map(function (t) {
return {
src: t.img
};
})
})), /*#__PURE__*/React.createElement("div", {
className: "OrderObject-count"
}, "\u5171".concat(count, "\u4EF6")), /*#__PURE__*/React.createElement(Icon, {
type: "chevron-right"
})) : /*#__PURE__*/React.createElement(Goods, _extends({
type: "order",
variant: "compact"
}, firstOrder)));
};