UNPKG

@kubit-ui-web/react-components

Version:

Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience

29 lines 1.29 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { Divider } from '../../divider/divider'; import { LineSeparator } from '../../lineSeparator/lineSeparator'; import { DividerInternalWrapper } from '../table.styled'; /** * @description * TableDivider component is used to display a divider between table rows. * It can be a string or a Divider component. * If it is a string, it will be rendered as a LineSeparator component. * If it is a Divider component, it will be rendered as a Divider component. * If it is null, it will not be rendered. * @example * <TableDivider dividerValue="test" /> * <TableDivider dividerValue={<Divider variant="dashed" />} /> */ export const TableDivider = ({ divider, styles }) => { if (!divider) { return null; } if (typeof divider === 'string') { return (_jsx(LineSeparator, { externalNodeTag: "td", label: { content: divider }, labelVariant: styles?.lineSeparatorLabelVariant, lineVariant: styles?.lineSeparatorLineVariant })); } const dividerVariant = divider.variant ?? styles?.dividerVariant; if (!dividerVariant) { return null; } return (_jsx(DividerInternalWrapper, { children: _jsx(Divider, { ...divider, variant: dividerVariant }) })); }; //# sourceMappingURL=tableDivider.js.map