@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.
27 lines (26 loc) • 937 B
JavaScript
"use client";
import * as React from "react";
import cx from "clsx";
import BadgeList from "../../BadgeList";
import { useItinerarySegmentMinimalColumnWidth } from "../context";
import ItineraryBadgeListItem from "./ItineraryBadgeListItem";
import { spaceAfterClasses } from "../../common/tailwind";
import useTheme from "../../hooks/useTheme";
const ItineraryBadgeList = ({
children,
spaceAfter,
...props
}) => {
const {
itinerarySegmentMinimalColumnWidth: offset
} = useItinerarySegmentMinimalColumnWidth();
const theme = useTheme();
return /*#__PURE__*/React.createElement("div", {
className: cx("orbit-itinerary-badge-list", spaceAfter && spaceAfterClasses[spaceAfter]),
style: {
marginInlineStart: `${2 * parseInt(theme.orbit.space300, 10) + offset}px`
}
}, /*#__PURE__*/React.createElement(BadgeList, props, children));
};
export default ItineraryBadgeList;
export { ItineraryBadgeListItem };