@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.
43 lines (41 loc) • 1.3 kB
JavaScript
import * as React from "react";
import styled from "styled-components";
import Calendar from "../../icons/Calendar";
import defaultTheme from "../../defaultTheme";
import Text, { StyledText } from "../../Text";
import Clock from "../../icons/Clock";
import Stack from "../../Stack";
import Badge from "../../Badge";
const StyledTripDate = styled.div.withConfig({
displayName: "TripDate__StyledTripDate",
componentId: "sc-1t2zo5b-0"
})(["display:flex;align-items:center;margin-bottom:", ";padding-bottom:", ";background:", ";z-index:1;", "{font-weight:", ";height:", ";}"], ({
theme
}) => theme.orbit.spaceXSmall, ({
theme
}) => theme.orbit.spaceXXSmall, ({
theme
}) => theme.orbit.paletteWhite, StyledText, ({
theme
}) => theme.orbit.fontWeightMedium, ({
theme
}) => theme.orbit.heightIconSmall);
StyledTripDate.defaultProps = {
theme: defaultTheme
};
const TripDate = ({
children,
dataTest,
duration
}) => React.createElement(StyledTripDate, {
"data-test": dataTest
}, React.createElement(Stack, {
direction: "row",
spacing: "condensed",
shrink: true
}, React.createElement(Calendar, {
size: "small"
}), React.createElement(Text, null, children)), duration && React.createElement(Badge, {
icon: React.createElement(Clock, null)
}, duration));
export default TripDate;