UNPKG

@kiwicom/orbit-components

Version:

Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.

46 lines (45 loc) 1.5 kB
"use client"; import * as React from "react"; import { ItemWrapper, getIconColor, VerticalBadge, BadgeContent } from "../../BadgeList/BadgeListItem"; import Stack from "../../Stack"; // TODO: remove after designers will resolve status colors // https://skypicker.slack.com/archives/GSGN9BN6Q/p1674568716519889 import Text from "../ItineraryTemporaryText"; const ItineraryBadgeListItem = ({ children, cancelledValue, withBackground, dataTest, type = "neutral", icon, strikeThrough }) => { return /*#__PURE__*/React.createElement(ItemWrapper, { dataTest: dataTest }, /*#__PURE__*/React.createElement(VerticalBadge, { type: type }, /*#__PURE__*/React.isValidElement(icon) && /*#__PURE__*/React.cloneElement(icon, { color: getIconColor(type) })), /*#__PURE__*/React.createElement(BadgeContent, { style: { marginTop: cancelledValue ? `4px` : "" } }, /*#__PURE__*/React.createElement(Stack, { direction: "column", spacing: "XXSmall" }, /*#__PURE__*/React.createElement(Text, { withBackground: withBackground, type: withBackground && type !== "neutral" ? type : "secondary", weight: withBackground ? "medium" : "normal", size: "small", as: "span", strikeThrough: strikeThrough }, children), cancelledValue && /*#__PURE__*/React.createElement(Text, { type: "secondary", size: "small", as: "span", strikeThrough: true, weight: "medium" }, cancelledValue)))); }; export default ItineraryBadgeListItem;