@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.
40 lines (38 loc) • 1 kB
JavaScript
import * as React from "react";
import styled from "styled-components";
import defaultTheme from "../../defaultTheme";
import ALIGN_OPTIONS from "./consts";
import { textAlign } from "../../utils/rtl";
export const StyledTableCell = styled(({
children,
className,
dataTest
}) => React.createElement("td", {
className: className,
"data-test": dataTest
}, children)).withConfig({
displayName: "TableCell__StyledTableCell",
componentId: "sc-1dr7ow2-0"
})(["box-sizing:border-box;font-family:", ";font-size:", ";color:", ";text-align:", ";"], ({
theme
}) => theme.orbit.fontFamily, ({
theme
}) => theme.orbit.fontSizeTextNormal, ({
theme
}) => theme.orbit.colorTextTable, ({
align
}) => textAlign(align));
StyledTableCell.defaultProps = {
theme: defaultTheme
};
const TableCell = ({
align = ALIGN_OPTIONS.CENTER,
dataTest,
children
}) => {
return React.createElement(StyledTableCell, {
align: align,
dataTest: dataTest
}, children);
};
export default TableCell;