@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.
30 lines (29 loc) • 1.13 kB
JavaScript
"use client";
import * as React from "react";
import cx from "clsx";
import handleKeyDown from "../../../utils/handleKeyDown";
import ChevronForward from "../../../icons/ChevronForward";
const ItinerarySegmentBanner = ({
onClick,
children,
ref
}) => {
return /*#__PURE__*/React.createElement("div", {
ref: ref,
className: cx("orbit-itinerary-segment-banner", "px-400 box-border flex w-full items-center justify-between overflow-hidden py-0", onClick ? "cursor-pointer" : "cursor-default", "[&_.orbit-itinerary-badge-list]:!ms-0", "[&_.orbit-separator]:-ml-400 [&_.orbit-separator]:!w-[150%]", "[&_>_div]:max-w-[calc(100%-20px)]"),
role: "button",
tabIndex: onClick ? 0 : -1,
onKeyDown: handleKeyDown(onClick ? ev => {
ev.stopPropagation();
if (onClick) onClick(ev);
} : undefined),
onClick: ev => {
ev.stopPropagation();
if (onClick) onClick(ev);
}
}, /*#__PURE__*/React.createElement("div", null, children), onClick && /*#__PURE__*/React.createElement(ChevronForward, {
color: "secondary",
ariaHidden: true
}));
};
export default ItinerarySegmentBanner;