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

32 lines 1.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ListDivider = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const divider_1 = require("../../divider/divider"); const lineSeparator_1 = require("../../lineSeparator/lineSeparator"); /** * @description * ListDivider component is used to display a divider between lists. * 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 * <ListDivider dividerValue="test" /> * <ListDivider dividerValue={<Divider variant="dashed" />} /> */ const ListDivider = (props) => { if (!props.divider) { return null; } if (typeof props.divider === 'string') { return ((0, jsx_runtime_1.jsx)(lineSeparator_1.LineSeparator, { label: { content: props.divider }, labelVariant: props.dividerStyles?.lineSeparatorLabelVariant, lineVariant: props.dividerStyles?.lineSeparatorLineVariant })); } const dividerVariant = props.divider.variant ?? props.dividerStyles?.dividerVariant; if (!dividerVariant) { return null; } return (0, jsx_runtime_1.jsx)(divider_1.Divider, { ...props.divider, variant: dividerVariant }); }; exports.ListDivider = ListDivider; //# sourceMappingURL=listDivider.js.map